Dynamic Code Manager Type
(Available from version 7.2 onwards)
The Dynamic Code Manager type allows you to execute .NET code (C# and VB) dynamically in your project. Compilation is delayed until the solution runs on the RT Client.
To use the Dynamic Code Manager type, create a variable of this type in your project, and drag and drop its methods and properties onto the canvas. Basic knowledge of either C# or VB is required.
The type is found under Variable > Complex variable > Built-In Types > General.
For instructions on how to create a Complex Variable, see here.
Methods

Sets the programming language of the code you want to run.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
Language |
Text |
The programming language of the code you want to run. Possible values: CSharp, C#, VB |
Returns
The method does not return a response.

Executes a block of code parsed as text.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
Code |
Text |
The code you want to run. Important: Only use statements, without a method declaration. |
paramsForMethod |
List of Text |
A list of the input parameters expected by the code (optional). |
paramTypes |
List of Text |
A list of the types of input parameters expected by the code (optional). Note that this list should correspond with the paramsForMethod list. |
Returns
If the method returns a value, it is returned as text.
Example
In the following example, the first statement uses Set Language to set the programming language, and the second statement uses Execute Code to execute a block of C# code, with input parameters. The code receives two integers, 2 and 5, and returns the greater.
To access paramsForMethod in the Code, you must reference the Parameters array, with the corresponding index, i.
Executed code:

Executes a specified method belonging to a class.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
Code |
Text |
The code containing the method you want to run. |
MethodName |
Text |
The name of the method you want to run. |
paramsForMethod |
List of Text |
A list of the input parameters expected by the method (optional). |
paramTypes |
List of Text |
A list of the types of input parameters expected by the method (optional). Note that this list should correspond with the paramsForMethod list. |
Returns
If the method returns a value, it is returned as text.
Properties

Property |
Type |
Description |
---|---|---|
Error |
Boolean |
Indicates whether there was an error in the code at compilation or runtime. |
Error Message |
Text |
A description of the code compilation or runtime error. |
Save Source Code |
Boolean |
If set to True, Automation Studio returns the code generated from your .NET code. This property is useful for resolving compilation errors. |
Generated Source Code |
Text |
If Save Source Code is set to True, this property holds the generated source code, as well as the .NET code. |
Scripting Language |
Text |
The programming language in which the code is executed. |