Space TimelineSpace Timeline

Defining and Calling JavaScript Functions

You may write JavaScript functions, and later call them from objects of the wizard. If you need to reuse a function to call it from multiple pages, then define it in the Wizard Settings > onLoad actions. Otherwise, define it in Page Settings > On Page Enter tasks for the page, where you will use it. Define a function you want to call upon within the $scope of the wizard. Then enter the name of the function into the respective field setting. For example, On value change setting of most fields. You may also call the function from any place that uses Field Execution Context, such as Rich Text fields, conditions, validations, etc. In such a case, use double-bracketed interpolation.

For example:

wizardState.removeJointOwner

Example
// This JavaScript function removes a Joint Owner. // To call it from a Java Script Action button, enter // wizardState.removeJointOwner into the Java Script Content setting. $scope.wizardState.removeJointOwner = function (whichOwner) { debugger; if (whichOwner=='Owner2') { $scope.wizardState.Owner2 = false; $scope.$emit('wizardEvent', 'backTonewAccountGeneralInfo') } else if (whichOwner=='Owner3') { $scope.wizardState.Owner3 = false; $scope.$emit('wizardEvent', 'backTonewAccountGeneralInfo') } else if (whichOwner=='Owner4') { $scope.wizardState.Owner4 = false; $scope.$emit('wizardEvent', 'backTonewAccountGeneralInfo') } }