Add a .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 can add a .NET action using simple class as input and/or output parameters, all public members/properties within the selected class object appears at design time.

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.

Supports the following controls/form variables (except form variable array) to map to the members/properties of a simple class:

  • Label

  • Text box

  • Drop-down (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

  • Drop-down

Note At design time, you cannot map fields or members to the simple class itself; each field must be mapped individually to each form control and for a complex class, map the sub members to each complex class' property individually.
  1. On the Form Modeling bar, click Actions.
  2. On the Actions page, click Add Generic Add.
  3. On the Type list, select .Net Method.
  4. Enter a Name and Description for the action.
  5. Optionally, configure a unique action for each language separately. See Configure multilingual actions for a form or control for more information.
  6. Consume the required assembly for example, TotalAgility.Sdk.dll in the Assembly box.
  7. If the selected .NET assembly is a signed assembly from the Global Assembly Centre (GAC) then Load Assembly Using Full Name is set to Yes by default.
  8. On the Class list, select the required class.
  9. On the Method list, select a method that accepts a class as an input or output parameter.

    The list of parameters appears.

  10. Map the parameters (members / properties) using either dynamic or static values.

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

    • TotalAgility does not support Dynamic Complex variable mappings on more than two levels.

  11. To configure the DataSet, do one of the following:
    • Consume a table control to the dataset.

    • To map the data set columns to table columns, click Add 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.
  12. Click OK.

    The newly created action is added to the table.

  13. Associate the action with the control that will trigger this action. Alternatively if you wish to call the .NET Method action on load of a form, then associate the action with the form. See Associate an action with a form or control.