Events and messages
AddItem
Description: Add an item to a repeatable SmartForm
Parameters: itemFullName, itemIndex
Example:
var message = {eventName:"AddItem",
message: { itemFullName: "MySubForm", itemIndex: 0 }};
window.postMessage(JSON.stringify(message), "*");
ItemAdded
Description: An item has been added to a repeatable SmartForm.
Return Example:
{
"eventName": "ItemAdded",
"message": {
itemFullName: "RepeatableName",
itemIndex: "Repe
}
}
RemoveItem
Description: Remove an item from a repeatable SmartForm
Parameters: itemFullName, itemIndex
Example:
var message = {eventName:"RemoveItem",
message: { itemFullName: "MySubForm", itemIndex: 0 }};
window.postMessage(JSON.stringify(message), "*");
ItemRemoved
Description: An item has been removed from a repeatable SmartForm.
Return Example:
{
"eventName": "ItemRemoved",
"message": {
oldItemFullName: "RepeatableName",
oldItemIndex: "RepeatableIndex"
}
}
CopyItem
Description: Copy the specified item from a repeatable SmartForm as the last item
Parameters: itemFullName, itemIndex
Example:
var message = {eventName:"CopyItem",
message: { itemFullName: "MySubForm", itemIndex: 0 }};
window.postMessage(JSON.stringify(message), "*");
ItemCopied
Description: An repeatable Smart Form item has been copied.
Return Example:
{
"eventName": "ItemCopied",
"message": {
sourceItemFullName: "SourceRepeatableName",
sourceItemIndex: "SourceRepeatableIndex",
destinationItemFullName: "DestinationRepeatableName",
destinationItemIndex: "DestinationRepeatableIndex"
}
}
MoveUpItem
Description: Move a repeatable SmartForm item up in the list
Parameters: itemFullName, itemIndex
Example:
var message = {eventName:"MoveUpItem",
message: { itemFullName: "MySubForm", itemIndex: 1 }};
window.postMessage(JSON.stringify(message), "*");
ItemMovedUp
Description: An repeatable Smart Form item has been moved up.
Return Example:
{
"eventName": "ItemMovedUp",
"message": {
sourceItemFullName: "SourceRepeatableName",
sourceItemIndex: "SourceRepeatableIndex",
destinationItemFullName: "DestinationRepeatableName",
destinationItemIndex: "DestinationRepeatableIndex"
}
}
MoveDownItem
Description: Move a repeatable SmartForm item down in the list
Parameters: itemFullName, itemIndex
Example:
var message = {eventName:"MoveDownItem",
message: { itemFullName: "MySubForm", itemIndex: 0 }};
window.postMessage(JSON.stringify(message), "*");
ItemMovedDown
Description: An repeatable Smart Form item has been moved down.
Return Example:
{
"eventName": "ItemMovedDown",
"message": {
sourceItemFullName: "SourceRepeatableName",
sourceItemIndex: "SourceRepeatableIndex",
destinationItemFullName: "DestinationRepeatableName",
destinationItemIndex: "DestinationRepeatableIndex"
}
}
FieldValueChanged
Description: A field from the SmartForm has its value changed.
Return Example:
{
"eventName": "FieldValueChanged",
"message": {
"fieldName": "DevTextBox",
"newValue": "New Text"
}
}
SetFieldValue
Description: Set the value for a selected field.
Parameters: fieldName, value
GetFieldValue
Description: Get the value of a selected field.
Parameters: fieldName
Return Example:
{
"eventName": "FieldValue",
"message": {
"fieldName": "DevTextBox",
"value": "Text value"
}
}
GetFields
Description: Get all the fields in the SmartForm
Return Example:
{
"eventName": "Fields",
"message": {
"fields": [{
"fieldName": "Test TextBox",
"fieldType": "TextBox"
},
{
"fieldName": "Test ComboBox",
"fieldType": "ComboBox"
}]
}
}
GetTemplateExecutionData
Description: Get Template Execution Data
Return Example:
{
"eventName": "TemplateExecutionData",
"message": {
"value": "<DynamicObject xmlns=\"http://online.xpertdoc.com/dynamicObject\"><DevTextBox>Text</DevTextBox><ComboBox1 /></DynamicObject>"
}
}
AddTemplateExecutionHandler
Description: Add Template Execution Handler
RemoveTemplateExecutionHandler
Description: Remove Template Execution Handler
CompleteTemplateExecution
Description: Complete Template Execution
CancelTemplateExecution
Description: Cancel Template Execution
Execute
Description: Executes the template
ExecuteFormValidations
Description: Execute SmartForm Validations
Return Example:
{
"eventName": "FormValidationsExecuted",
"message": {
"isValid": true
}
}
GetOptions
Description: Get options
Return Example:
{
"eventName": "Options",
"message": {
"promptTemplateExecutionResults": true
}
}
SetOptions
Description: Set options
Parameters: promptTemplateExecutionResults
PromptTemplateExecutionResults
Description: Prompt Template Execution Results
Parameters: templateExecutionId
PromptTemplateExecutionResult
Description: Prompt Template Execution Result
Parameters: templateExecutionResultId
SaveFormAsDraft
Description: Save As Draft
Parameters: createNewDraft
Return Example:
{
"eventName": "FormSavedAsDraft",
"message": {
"templateExecutionDataId": "00000000-0000-0000-0000-000000000000"
}
}
PreviousDraftLoaded
Description: A previous draft was loaded.
Return Example:
{
"eventName": "PreviousDraftLoaded",
"message": {
"templateExecutionDataId": "00000000-0000-0000-0000-000000000000"
}
}
FillForm
Description: Fill the SmartForm
Parameters: draftId, disableConfirmation, forgetDraftReference
Return Example:
{
"eventName": "PreviousDraftLoading",
"message": {
"templateExecutionDataId": "00000000-0000-0000-0000-000000000000"
}
}
{
"eventName": "FieldValueChanged",
"message": {
"fieldName": "DevTextBox",
"newValue": "New Text"
}
}
{
"eventName": "PreviousDraftLoaded",
"message": {
"templateExecutionDataId": "00000000-0000-0000-0000-000000000000"
}
}
ShowPreviousExecutionData
Description: Shows the Previous Executions and Drafts window
TemplateExecuting
Description: The template is executing.
Return Example:
{
"eventName": "TemplateExecuting",
"message": {
"templateId": "00000000-0000-0000-0000-000000000000"
}
}
TemplateExecuted
Description: The template was executed
Return Example:
{
"eventName": "TemplateExecuted",
"message": {
"templateId": "00000000-0000-0000-0000-000000000000",
"templateExecutionId": "00000000-0000-0000-0000-000000000000",
"success": true,
"errorMessage": null
}
}
Logout
Description: Logout
Updated almost 7 years ago