Can you have both a OOC and Advance condition script on an email notification

Peter Williams
Kilo Sage

Good Day,

i am trying to configure an email notification to go off the following information.

 

PeterWilliams_0-1702058983519.png

 

However, the Variables condition for Current Location isn't working and i will need to script this out.

So is it possible to have the OOC seen above + Advance condition running for the Current location like

 

var loc = current.variables.current_location.getDisplayValue();

 

if (loc == 'Toronto'){

answer = true;

}

answer = false;

 

1 ACCEPTED SOLUTION

i found the solution that will work

if(current.variables.current_location == 'Calgary' && current.u_revision_version.changes() && current.order_guide.name =='Changes'){
    answer=true;
}else{answer = false;}

View solution in original post

6 REPLIES 6

Peter Williams
Kilo Sage

would i be able to use this instead?

 

if(current.variables.current_location == 'Calgary' && current.u_revision_version.changes() && current.order_guide.name =='Changes'){
    answer=true;
}else{answer = false;}


Community Alums
Not applicable

Not sure if getDisplayValue() work here, so you can try just:

if (current.variables.current_location == 'Toronto'){ //use your actual value here - Toronto may be toront, trnt, etc - check this.

answer = true;

}

answer = false;

Also, it's very important where you set the notification - on REQ or RITM ? 

i found the solution that will work

if(current.variables.current_location == 'Calgary' && current.u_revision_version.changes() && current.order_guide.name =='Changes'){
    answer=true;
}else{answer = false;}

Community Alums
Not applicable

Glad to hear that 🙂 

It seems you indeed need to compare the values without using getDisplayValue().

Anyways - as there are lots of things that might go wrong with RITMs and notifications, I try to keep to this approach - I create 1 business rule in which I am triggering events (in turn firing my notification) where I can be 100% sure of what is my catalog item name (via my RITM or if the notification is needed to be on REQ then there) dotwalking it and be confidents of the states of any field I need for my logic.

Just an idea of mine for you of course - I do it that way from a long time and it's working fine for me for the past 5 years 🙂