Configure the SignedWrite() script function
- Last UpdatedJul 16, 2024
- 2 minute read
You can create a dashboard application to automate routine use of Secured and Verified Write by means of the SignedWrite() function.
To configure the SignedWrite() script function
-
Open the System Platform IDE.
-
Create a graphic and associate it with an attribute configured with Secured Write or Verified Write. For more information on associating attributes with graphic, see the Application Server User Guide, "Creating and Working with UDAs" topic.
-
Add the SignedWrite script function to the graphic. The following editor detail shows the buttons configured with scripts in the applied example:
-
Configure the scripted functionality you require. Scripts for the buttons shown in the example are as follows:
-
Hard-coded DataUDO.SecUDA: The following example sets the value of 23 to DataUDO.SecUDA. The user optionally can enter a comment, but no pre-defined comment list is available.
DataUDO.RetStatus=SignedWrite("DataUDO.SecUDA", 23, "Set the Value", True, 0, null);
-
Attribute Pointer has DataUDO.SecUDA: The source to be written to is passed as a parameter to the function. Attribute_Pointer is a custom property whose value is set to DataUDO.SecUDA.
The following example sets the value of 23 to DataUDO.SecUDA. The user optionally can enter a comment, but no pre-defined comment list is available.
DataUDO.RetStatus=SignedWrite(Attribute_Pointer, 23, "Set the Value", True, 0, null);
-
Attribute Pointer and Pre-Defined List: The pre-defined comment list is an array. This example extends the functionality of example b to force the user to enter a comment (Comment_Enforcement parameter set to 1) and also presents a pre-defined set of comments linked to the DataUDO.PreDefComments[ ] array.
The following example will set the value of 23 to DataUDO.SecUDA. The user must enter a comment and may use one from the pre-defined comment list.
DataUDO.RetStatus=SignedWrite(Attribute_Pointer, 23, "Set the Value", True, 1, DataUDO.PreDefComments[]);
-
Variable Array: The predefined list is a pointer to an array. This example extends the functionality of example c to force the user to enter a comment (Comment_Enforcement parameter set to 1) and also presents a predefined set of comments linked to DataUDO.PreDefComments[ ] array.
The value of custom property CP1 is "DataUDO.PreDefComments[ ]".
The following example will set the value of 23 to DataUDO.SecUDA. The user must enter a comment and may use one from the pre-defined comment list.
dim xInd as Indirect;
xInd.BindTo(CP1);
DataUDO.RetStatus=SignedWrite(Attribute_Pointer, 23, "Set the Value", True, 1, xInd);
-
All Parameters Variable: The predefined list array is built into the script. All parameters are passed as variables.
The following example will set the value of 23 to DataUDO.SecUDA . The user must enter a comment and may use one from the pre-defined comments list.
dim MyList[5] as string;
MyList[1] = "Batch Accepted";
MyList[2] = "Batch Rejected";
MyList[3] = "Batch on Hold";
MyList[4] = "Batch Resumed";
MyList[5] = DataUDO.PreDefComments[4];
DataUDO.RetStatus=SignedWrite(Attribute_Pointer, SignedWrite_Value_Ptr, SignedWrite_Reason, Enable_Edit_Comment, Comment_Options, MyList[]);
-