call (workflowRuleId, parameters)

Call a workflow rule. Custom workflow rules allow you to implement application-specific business logic, such as modifying data values before save, saving multiple records to different tables as a single transaction, or sending email notifications after save.

Parameters:

  • workflowRuleId (String): workflow rule ID
  • parameters : (optional) input parameters to be sent to the workflow rule; One of the following:
    Ab.data.Record object
    • array of Ab.data.Record objects
    • JS parameters object

Example:

Send a single record as a parameter to the Workflow.call() method:

var record = this.requestForm.getRecord();
try {
Workflow.call('AbSolutionsViewExamples-saveRequest', record);
} catch (e) {
Workflow.handleError(e);
}

If you need to pass additional parameters, use the parameters object for the record and all other parameters:

var record = this.requestForm.getRecord();
try {
Workflow.call('AbSolutionsViewExamples-saveRequest', {
record: record,
notifyMe: this.notifyMe });
} catch (e) {
Workflow.handleError(e);
}