.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, and 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 a 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 types 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
-
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.
-
On the form modeling bar, click
Actions and click
New.
The New action dialog box is displayed.
- On the Type list, select .Net method.
- Change the default Name (DotNetMethod1) to something meaningful.
- Optional. Enter a Description for the action.
- Optional. To allow this action to support different behavior for different languages, select Multilingual. See Configure multilingual actions for more information.
-
Click
Configure.
The Configure .Net action dialog box is displayed.
-
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.
-
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.
- On the Class list, select the required class.
- On the Method list, select a method that accepts a class as an input or output parameter.
-
For each parameter, map the form control, form variable or global variable using dynamic or static values.
If a parameter type contains a question mark (for example, Boolean?), it indicates the parameter is nullable.
-
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 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.
Dataset type for method input parameters is not supported. Only the return type of dataset can be mapped to a Table. At runtime, the table is populated with the data in the dataset.
-
- Click OK.
-
Click
Save.
The newly created action is added to the list.
- 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.
See also: