ExecuteAction()
An ExecuteAction() function calls a predefined java script action on a document attached to some case. It uses the following actions (see also „Function arguments” or „Examples” sections below):
- signDocument (requires fieldName);
- showDocumentSignatures (requires fieldName or attachmentName);
- download (requires fieldName or attachmentName);
- openTrustCenterUrl (requires fieldName or attachmentName);
- openTrustCenterRepresentativeUrl (requires fieldName or attachmentName);
- uploadfile (required fieldName).
After applying one of the above actions on the document (it may be attached to some document-type field or placed in the case attachment list) the ExcuteAction() function will return boolean value indicating success or not.
See also: Function ExecuteAction() – how it works
Syntax
ExecuteAction(actionObject);
Function arguments
actionObject argument takes the following attributes:
- action – (String) an action to be executed, allowed values:
- „signDocument”,
- „showDocumentSignatures”,
- „download”,
- „openTrustCenterUrl”,
- „openTrustCenterRepresentativeUrl”,
- „uploadfile”;
- attachmentName – (String) a name of the attachment file on which the action is performed;
- fieldName – (String) a name of the document-type field on which the action is performed;
- caseId – (String) [optional] an id of the related case (a row in table on the form) on which action is performed.
Return value
This function returns Boolean.
This function returns true or throws an exception with error information.
Examples
Example 1
This will perform the „download” action on a file placed in the case form document-type field named „Document scan”.
actionObject.action = "download"; actionObject.fieldName = "Document scan"; ExecuteAction(actionObject);
Example 2
This will perform the „uploadfile” action on a file placed in the case form document-type field named „Document scan”.
actionObject.action = "uploadfile"; actionObject.fieldName = "Document scan"; ExecuteAction(actionObject);
Example 3
This will perform the „uploadfile” action on a file placed in the related table row with id 12 on document-type field named „Document scan”.
actionObject.action = "uploadfile"; actionObject.fieldName = "Document scan"; actionObject.caseId = 12; ExecuteAction(actionObject);
See also: Function ExecuteAction() – how it works