Business rule for clearing a value is not working

Cupcake
Mega Guru
 

I created a catalog item that has a variable called New Information Needed (this variable is a type = Yes/No). That variable is a Yes/No variable type and is REQUIRED. That variable is only visible on Task # 2 in my workflow which has a Rollback activity. So when the wf starts, Task 1 generates. I close complete the task, then Task # 2 generate and the New Information Needed variable is required. When you answer "yes" to that question and then mark the task Closed Complete - the rollback activity kicks in - which will cause Task # 2 to change from a state of Closed Complete to a State = Pending.

What I am looking to do is when that state changes to pending I want to clear the value of "Yes" in that task to "blank". I don't want any value in that field.

Here is my business rule which does not seem to be working:

find_real_file.png

 

find_real_file.png

22 REPLIES 22

Dylan Mann1
Giga Guru

So the Yes/No variable is a boolean type, so it's either true or false. So instead of setting it as an empty string set it as false and it should work. Also, you may not even need to do this as a script. You can set you condition of the state changing to -5 in the "When to run" section and set the value in the "actions" section. 

Let me know if this helps,

Dylan

Thank you Dylan,

     I tried doing it via a condition; however the "Pending" state is not in the list of values to select from. Maybe because I am doing this on the task table. And if I change the table to sc_task table the state values also DOES NOT include the "Pending" value.

 

 

Ok so in that case it makes sense to script this out. I am noticing an error in your conditional. I think the correct syntax would be: current.state.changesTo(-5)

Then in your script you can set the field as false.

Thank you Dylan,

     I just changed everything and tested and it still didn't work. Not sure why this is such a PAIN IN THE NECK. Lol ! 

 

Here is the workflow - maybe that will help.