- Contents
Exchange Manager Help
Define a Destination Field Value Using C# Script
Use the Define Destination Field Value dialog box to use C# script to process values in the source field before storing them in the destination field.
To define a destination field value using C# script
-
In the Navigation pane, click Clients.
-
In the Clients pane, expand the appropriate folder and then double-click the client. The tab for the specified client appears in the Information pane.
-
Click the Import Files tab and then click the New Business, Financial Transactions, Maintenance, or Final Recall tab, depending on the import file type.
-
Click Modify File Mapping. The Data Translator window appears.
-
Click the Mapping tab.
-
In the Destination pane, double-click a mapped destination field. The Define Destination Field Value dialog box appears.
-
Click Script. The C# Script tab appears.
-
Type the C# script to use to check values, parse data, or perform any other function on the source field before populating the destination field. For example, the following script removes dashes from the data:
using System;
using System.Globalization;
public class Script : Scripter.DefaultScriptBase
{
public Script()
}
public override string GetScriptValue(string str1)
{
return str1.Replace("-","");
}
public override string GetScriptValue(string str1, string str2)
{
throw new ApplicationException("Script method not implemented yet");
}
public override string GetScriptValue(string str1, string str2, string str3)
{
throw new ApplicationException("Script method not implemented yet");
}
public override string GetScriptValue(string[] args)
{
throw new ApplicationException("Script method not implemented yet");
}
}
Note: The first line ALWAYS contains "public class Script : Scripter.ScriptBase" to implement the three methods indicated. If C# code is referencing the Latitude file number field, return a -1 for an empty string. Otherwise, the number increments by one until the C# script returns a new number.
-
Click OK.
-
In the menu bar, click Advanced and then click Save Mapping Definition. The Save As dialog box appears.
-
In the File name box, type a name for the file and then click Save.