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 stackTrace
string context
string -
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 serviceName
The form action service definition name (required) serviceVersion
<optional>
The form action service definition version number. milestone
string <optional>
A transaction milestone event to record with the transaction, maximum length should be 100 characters. params
Object 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 milestone
string <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 milestone
string <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 userSaved
Specify whether to set submission.user_saved_flag so that submission automatic abandonment will not occur sendEmailSavedForm
Specify whether to send an "Form Saved" email message to the specified user emailAddress parameter emailAddress
string The email address of the user to send the milestone
string <optional>
A transaction milestone event to record with the transaction, maximum length should be 100 characters (optional) addAttachmentManually
Object The add submit manually file attachment - use the method `makeAddAttachmentManually` to obtain this removeAttachment
Object The remove file attachment metadata - use teh method `makeRemoveAttachment` to obtain this addAttachmentFile
Object The add file attachment metadata - use the method `makeAddAttachmentFile` to obtain this fileContent
File 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 pathOrItem
attachmentKey
attachmentName
Returns:
- 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 pathOrItem
attachmentKey
attachmentName
Returns:
- 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 pathOrItem
attachmentKey
attachmentName
Returns:
- Type
- Object
-
Transact.referenceData(name, query, locale, hideProgressFlag, hideAlertError)
-
Fetches named reference data from the organization in TM
Parameters:
Name Type Description name
Reference data set name query
Query to filter the reference data set (see TM reference data documentation) locale
string If the reference data set has multiple translations available, this locale code is used to select the appropriate one. hideProgressFlag
boolean Do not show progress while the reference data is being fetched hideAlertError
boolean 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 milestone
string <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 sendEmailSavedForm
Specify whether to send an "Form Saved" email message to the specified user emailAddress parameter sendEmailShareForm
Specify whether to send a "Form Shared" email message to the user specified by the emailAddress parameter emailAddress
string The email address of the user to send the milestone
string <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 sendEmailFormReceipt
Specify whether to send an "Form Receipt" email message to the specified user emailAddress parameter emailAddress
string The email address of the user to send the milestone
string <optional>
A transaction milestone event to record with the transaction, maximum length should be 100 characters (optional)