- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2017 12:12 AM
Hi All
I created a workflow named "CheckDocumentCompletedForSurgery".
now i want to trigger/start this workflow from business.
(function executeRule(current, previous /*null when async*/) {
// Add your code here.
})(current, previous);
what should i write in executeRule function so that my workflow get triggered.
Please help me. I am new to ServiceNow.
Thanks in Advance.
Best regards,
Pratap Ranawat
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2017 12:14 AM
Hi Pratap,
(function executeRule(current, previous /*null when async*/) {
// This business Rule will trigger Breakfix Return Workflow when State changes from In Use to In Maintenance
var wflw = new Workflow();
wflw.startFlow(wflw.getWorkflowFromName('give the workflow name'), current, 'update');
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2017 12:14 AM
Hi Pratap,
(function executeRule(current, previous /*null when async*/) {
// This business Rule will trigger Breakfix Return Workflow when State changes from In Use to In Maintenance
var wflw = new Workflow();
wflw.startFlow(wflw.getWorkflowFromName('give the workflow name'), current, 'update');
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2017 12:55 AM
Hi Sneha,
I am getting this error
Error Message
Workflow undefined, maybe missing global qualifier
while using above code. what could be possible reason?
Thanks,
Best regards,
Pratap Ranawat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2017 01:23 AM
Are you providing the correct Workflow name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2017 02:18 AM