- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2016 04:42 PM
Hi all,
I have a question. Our requirement is that when a user orders a catalog item, the request is auto approved and the requested item records (RITM''s) are sent to the appropriate users for approval. This is fairly simple and has been configured. Now the requirement is that if the requestor is either a CEO, VP, SVP, Director then the requested item records(RITM' s) should be auto approved. They shouldn't go to an approver. The status of the RITM should automatically be set to order fulfillment and the fulfiller groups will works on their tasks and the requestor will receive his ordered item. Other users will go through the approval process. How do I configure the workflow for auto approvals based on the title of the users. Any help would be great!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2016 05:24 PM
Hi,
You can create "If activity" in the workflow and place it before "Approval activity" with the script as. Modify it as per your req.
answer = ifScript();
function ifScript() {
if (current.request.requested_for.title == "Director" || current.request.requested_for.title == "VP" || current.requested_for.title == "CEO") {
return 'no';
}
else{
return 'yes';
}
}
Please let me know if you have any questions.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2016 05:24 PM
Hi,
You can create "If activity" in the workflow and place it before "Approval activity" with the script as. Modify it as per your req.
answer = ifScript();
function ifScript() {
if (current.request.requested_for.title == "Director" || current.request.requested_for.title == "VP" || current.requested_for.title == "CEO") {
return 'no';
}
else{
return 'yes';
}
}
Please let me know if you have any questions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2016 09:53 PM
Thank you so much pradeepksharma!! Works perfectly. Just made a small change.
Instead of current.requested_for.title used current.request.requested_for.title

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2016 09:56 PM
Excellent. Thanks for participating in the community!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2022 11:43 AM