Set Forms Parameters
- Last UpdatedJun 25, 2024
- 2 minute read
Set forms parameters to manage controls on a form at run-time.
Setting Forms Parameters through Form Links
-
When you create a Form Link, you can select and type values for the parameters. For more information,see Creating Forms Links.
Setting Forms Parameters through Pop-Up Control
-
When you create a Pop-Up control, you can select parameters and map it to parent form controls. For more information, see To add Form Details for the Control under Form Details property in Pop-Up.
Setting Forms Parameters through External Systems
The forms parameter must be specified in JSON (JavaScript Object Notation) string format with attribute–value pairs. Multiple forms parameters can be specified by separating them with commas.
Syntax
// extForParam is the global variable used for setting Forms Parameters.
window.extFormParam = { "<formsParameterName>": { "id": <idValue>, "mappedParentControl": "<mappedParentControlValue>", "name": "<formsParameterName>", "type": "<formsParameterType>", "value": "<formsParameterValue>" } };
|
Value |
Description |
|---|---|
|
<formsParameterName> |
Name of the forms parameter. |
|
<idValue> |
Value of the forms parameter ID. This value is optional. Use null if no value is used. |
|
<mappedParentControlValue> |
Value of the forms parameter mapped to the parent control. This value is optional. Use "" if no value is used. |
|
<formsParameterType> |
Type of the forms parameter. For more information about, see Types of Forms Parameters. |
|
<formsParameterValue> |
Value of the Forms Parameter. |
Example
Setting Forms Parameters through an HTML page
If you can want to populate the First Name and the Last Name text controls on the Employee form with values from the FName and the LName forms parameters, then you can code the form and the HTML page as follows:
Script the On Form Load property of the Employee form to populate the text controls with the values from the forms parameters.
// T1and T2 are the Text controls for the First Name and the Last Name respectively.
control.findById("T1").value = control.topLevelForm.formParameters["FName"].value;
control.findById("T2").value = control.topLevelForm.formParameters["LName"].value;
Code the HTML page to set the values for the forms parameters.
// John and Doe are values set to FName and LName respectively.
// extForParam is the variable used for setting Forms Parameters.
// This code must appear before the loadViewAndViewModelFromServer() function.
window.extFormParam = { "FName": { "name": "FName", "type": "STRING", "value": "John" }, "LName": { "name": "LName", "type": "STRING", "value": "Doe" } };