Methods
-
Transact.formError(stackTrace, context)
-
Call the `formError` Form UX command. This is for internal use rather than targeted at form developers. This command type enables recording information about an unexpected JavaScript error in the application and storing this information in the TM Error Log for operational support. Error Log records would include the JavaScript stacktrace and any context information specified by the application. These error log records would be associated with the submission record enabling analysis of application specific errors.
Parameters:
Name Type Description stackTracestring contextstring -
Transact.formFunction(serviceName [, serviceVersion] [, milestone], params)
-
If using the TM Form Function API (available as a publish option in Maestro - form must be published to TM post 17.10) this can be used to call Transact Form Functions.
Parameters:
Name Type Argument Description serviceNameThe form action service definition name (required) serviceVersion<optional>
The form action service definition version number. milestonestring <optional>
A transaction milestone event to record with the transaction, maximum length should be 100 characters. paramsObject The parameters to the specified form function. This takes the form of an object, where each key is a parameter name. The object value for that key is delivered as the value for that parameter. -
Transact.formIneligible( [milestone])
-
Calls the `formIneligible` operation of the HTTP Form API. Compatible with TM server version 17.10 and onwards.
Parameters:
Name Type Argument Description milestonestring <optional>
A transaction milestone event to record with the transaction, maximum length should be 100 characters. -
Transact.formLoad()
-
Calls the formLoad operation of the HTTP Form API. Compatible with TM server version 17.10 and onwards.
-
Transact.formStart( [milestone])
-
Calls the formStart operation of the HTTP Form API. Compatible with TM server version 17.10 and onwards.
Parameters:
Name Type Argument Description milestonestring <optional>
A transaction milestone event to record with the transaction, maximum length should be 100 characters (optional) -
Transact.formUpdate(userSaved, sendEmailSavedForm, emailAddress [, milestone], addAttachmentManually, removeAttachment, addAttachmentFile, fileContent)
-
Calls the formUpdate operation of the HTTP Form API. Compatible with TM server version 17.10 and onwards. The parameters `addAttachmentManually`, `removeAttachment` and `addAttachmentFile` can be specified with appropriate metadata using the associated helper methods, detailed separately in the parameter descriptions below. It is expected that only one of these parameters (or none of them) would be provided for any one call, the others can be either left off (if they appear after any other necessary parameters) or provided with a null or undefined value.
Parameters:
Name Type Argument Description userSavedSpecify whether to set submission.user_saved_flag so that submission automatic abandonment will not occur sendEmailSavedFormSpecify whether to send an "Form Saved" email message to the specified user emailAddress parameter emailAddressstring The email address of the user to send the milestonestring <optional>
A transaction milestone event to record with the transaction, maximum length should be 100 characters (optional) addAttachmentManuallyObject The add submit manually file attachment - use the method `makeAddAttachmentManually` to obtain this removeAttachmentObject The remove file attachment metadata - use teh method `makeRemoveAttachment` to obtain this addAttachmentFileObject The add file attachment metadata - use the method `makeAddAttachmentFile` to obtain this fileContentFile The DOM File object with content as per: https://developer.mozilla.org/en-US/docs/Web/API/File -
Transact.makeAddAttachmentFile(pathOrItem, attachmentKey, attachmentName)
-
Creates an object suitable for passing to the `addAttachmentFile` parameter of the `formUpdate` method.
Parameters:
Name Type Description pathOrItemattachmentKeyattachmentNameReturns:
- Type
- Object
-
Transact.makeAddAttachmentManually(pathOrItem, attachmentKey, attachmentName)
-
Creates an object suitable for passing to the `addAttachmentManually` parameter of the `formUpdate` method.
Parameters:
Name Type Description pathOrItemattachmentKeyattachmentNameReturns:
- Type
- Object
-
Transact.makeRemoveAttachment(pathOrItem, attachmentKey, attachmentName)
-
Creates an object suitable for passing to the `removeAttachment` parameter of the `formUpdate` method.
Parameters:
Name Type Description pathOrItemattachmentKeyattachmentNameReturns:
- Type
- Object
-
Transact.referenceData(name, query, locale, hideProgressFlag, hideAlertError)
-
Fetches named reference data from the organization in TM
Parameters:
Name Type Description nameReference data set name queryQuery to filter the reference data set (see TM reference data documentation) localestring If the reference data set has multiple translations available, this locale code is used to select the appropriate one. hideProgressFlagboolean Do not show progress while the reference data is being fetched hideAlertErrorboolean Do not show an alert error if there is a failure - you should handle error reporting as part of a catch block on the returned promise. -
Transact.userCancel( [milestone])
-
Calls the userCancel operation of the HTTP Form API. Compatible with TM server version 17.10 and onwards.
Parameters:
Name Type Argument Description milestonestring <optional>
A transaction milestone event to record with the transaction, maximum length should be 100 characters (optional) -
Transact.userSave(sendEmailSavedForm, sendEmailShareForm, emailAddress [, milestone])
-
Calls the userSave operation of the HTTP Form API. Compatible with TM server version 17.10 and onwards. When setting the parameter -`sendEmailShareForm` to true requires the System Profile to contain an element named `ShareForm` that contains a property `EmailAddresses`, `EmailBody` and `SenderName`. This can be set in a service on Journey Manager or be set in the form using the following commands:
Setting the required fields using a single JSON parameterForm.setSystemData("ShareForm", {'EmailAddresses':'[email protected]', 'EmailBody':'Someone has shared a form with you', 'SenderName':'Example User'})Setting the fields with single values, eg you can pre-populate values that won't change and update the parts in the form that will changeForm.setSystemData("ShareForm.EmailAddresses", "[email protected]") Form.setSystemData("ShareForm.EmailBody", "This form has been shared with you") Form.setSystemData("ShareForm.SenderName", "Some user filling in form")Parameters:
Name Type Argument Description sendEmailSavedFormSpecify whether to send an "Form Saved" email message to the specified user emailAddress parameter sendEmailShareFormSpecify whether to send a "Form Shared" email message to the user specified by the emailAddress parameter emailAddressstring The email address of the user to send the milestonestring <optional>
A transaction milestone event to record with the transaction, maximum length should be 100 characters (optional) -
Transact.userSubmit(sendEmailFormReceipt, emailAddress [, milestone])
-
Calls the userSubmit operation of the HTTP Form API. Compatible with TM server version 17.10 and onwards.
Parameters:
Name Type Argument Description sendEmailFormReceiptSpecify whether to send an "Form Receipt" email message to the specified user emailAddress parameter emailAddressstring The email address of the user to send the milestonestring <optional>
A transaction milestone event to record with the transaction, maximum length should be 100 characters (optional)