Changes

Workflows Overview

37 bytes added, 17:32, 7 July 2017
Trigger a Workflow from a Custom Browser Script
==Trigger a Workflow from a Custom Browser Script==
Workflows can be triggered based on a value in a custom field on the object using a browser script: 
_triggerwf(objectid,workflowid,Entity ID);
You must first create the workflow. Once it has been created you need the workflow ID.
In the browser script you would use triggerwf with the following syntax:<br> '''Level 1''': _triggerwf('@opportunityid@',''workflowid'');<br> :Example:   _triggerwf('@opportunityid@',98765);  Level 2: _triggerwf('@eventid@',workflowid,26);
Example:
'''Level 2''': _triggerwf('@eventid@',''workflowid'',26);<br>:Example: _triggerwf('@eventid@',98765,26);('''26''' is the objecttype for Level 2 activities, and will be the same for all Level 2 workflows)
(26 is the objecttype for Level 2 activities, and will be the same for all Level 2 workflows)
NOTE: For workflows triggered by a Browser Script within a UTA you should set Trigger When to --Deactivate-- rather than selecting a Status. This ensures that the workflow is only triggered when called by the script, and there is no risk of triggering it when a status changes.
Smartstaff, administrator
4,478
edits