To create custom code within the Code Editor follow these steps:


  • Select the language you wish to use with the language drop down of either VB.NET or C#.NET



  • Modify the execute method, adding any values to the values object:


/// <summary>

/// Enter the custom code within the execute method.

/// The values displayed to the user are stored in the "Values" property.

/// </summary>

public override void Execute()

{

Values.Add("Sample");

Values.Add("Sample2");

Values.Add("Sample3");

}


  • For the example above, the following is displayed to the user:

       


  • It is possible to display descriptive text to the user whilst providing a different value to the automation engine. To use display text, use the overloaded Add() method to provide both the display text and the value:

    /// <summary>

    /// Enter the custom code within the execute method.

    /// The values displayed to the user are stored in the "Values" property.

    /// </summary>

    public override void Execute()

    {

         Values.Add("US Dollar", "$US");

         Values.Add("Canadian Dollar","$CAD");

         Values.Add("Great British Pound", "£GBP");

    }


  • Standard .NET exception handling applies to custom code.

    throw new ArgumentException("Unable to populate the values of the dynamic variable.");