The Zurich release has arrived! Interested in new features and functionalities? Click here for more

How to make RITM workflow wait for Request Approval in Order Guide

Bruler1230
Tera Expert

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

13 REPLIES 13

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

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.

Thanks. I will give this a try tomorrow and let you know how I end up.

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. 

Has to be after Begin activity.