.Net method action

Use a .Net method action to:

  • Call an API for performing actions such as creating a new job, case, job in case, retrieving job properties. You can call multiple versions of .Net methods without having to write any code.

  • Perform an action by using the data supplied and returning new data. For example, the CalculateCreditScore method is used to pass in a customer's account details and return the customer's credit score rating.

When you add a .Net action using simple class as input and/or output parameters, all public members/properties within the selected class object appear at design time.

The .Net method action supports the following:

  • Formats for form data: Simple data type such as String, Integer, Short, or GUID. For example, the CalculateCreditScore method returns a customer's credit score (data type Short), which can be mapped to a text box to populate the credit score.

  • Controls/form variables (except form variable array) to map to the members/properties of a simple class:

    • Label

    • Textbox

    • Dropdown (the selected value)

    • Check box

    • Hyperlink

    • Calendar

    • Radio button

  • Supports the following controls/form variables to map to the members/properties of a complex class:

    • Form Variable Array

    • Table

    • Dropdown

Note At design time,
  • For a simple class, do not map fields or members to the simple class itself; instead, map each field individually to each form control

  • For a complex class, map the sub-members to each complex class' property individually.

  1. On the form modeling bar, click Actions and click New.

    The New action dialog box is displayed.

  2. On the Type list, select .Net method.
  3. Change the default Name (DotNetMethod1) to something meaningful.
  4. Optional. Enter a Description for the action.
  5. Optional. To allow this action to support different behavior for different languages, select Multilingual. See Configure multilingual actions for more information.
  6. Click Configure.

    The Configure .Net action dialog box is displayed.

  7. On the Assembly file path list, select the required local or store .Net assembly, such as TotalAgility.Sdk.dll.

    The available classes and methods associated with the selected .Net assembly appear on the Class list and Method list. The associated parameters are also displayed.

  8. If the selected .NET assembly is a signed assembly from the Global Assembly Centre (GAC), Load assembly using full name is selected by default.

    The Load assembly using full name option is only available if you select a local assembly for Assembly file path.

  9. On the Class list, select the required class.
  10. On the Method list, select a method that accepts a class as an input or output parameter.
  11. For each parameter, map the form control, form variable or global variable using dynamic or static values.

    Note If a parameter type contains a question mark (for example, Boolean?), it indicates the parameter is nullable.

  12. To configure the DataSet, do one of the following:
    • Select a Table control for the dataset.

    • To map the data set columns to table columns, click Add for DataSet, expand Return parameter, enter a name for the dataset column (a dataset column name should be the same as the database column name) and then consume the table column in the dataset object value. Repeat the steps to add more columns to the dataset.

    Note At runtime, the table is populated with the data in the dataset.
  13. Click OK.
  14. Click Save.

    The newly created action is added to the list.

  15. Associate the action with the control to trigger this action. See Configure actions for form control events. Alternatively to call this action for a form event, associate the action with the form. See Associate an action with a form.