How to make RITM workflow wait for Request Approval in Order Guide
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2019 09:00 AM
Hello,
I have an order guide that requires approval, which will be done in the sc_request workflow. Depending on what the user chooses, there could up to 3 RITMs that come out of this order guide. Each RITM has its own workflow. The problem i am having is how to make the RITMs workflow not run until the approval is complete in the Request workflow. Right now, as soon as i submit the order guide, the Request workflow is waiting for approval, but the RITMs start running through their workflows before the approval is granted. Do i need to put some kind of wait for condition at the beginning of the RITM workflows? Is it possible to get values from the Request workflow into the RITM workflow? Does anyone have any ideas of how i could handle this?
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2019 12:27 PM
Do you have any examples of how i could check if the parent request is approved? and would this wait condition be at the beginning of the ritm workflow?
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2019 12:46 PM
Try this in the wait for condition at the beginning of the workflow.
answer = true;
var pr = new GlideRecord('sc_request');
pr.addQuery('number', current.request);
pr.query();
while(pr.next()){
if(pr.request_state != approved){ // value of state "Aproved"
answer = false;
}
}
Mark my answer as correct or helpful if it helped.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2019 08:24 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2019 08:20 AM
Just to clarify...does the wait condition need to go before the Begin activity? or after? If before, how do i get it to run the wait condition first? Right now when i try it, it skips the wait activity and starts on the begin activity. thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2019 07:20 AM
Has to be after Begin activity.