Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Set active to False

Jeffce
Tera Expert

Is this a business rule? I have changes that are closed incomplete but still show active? Where is this flag set?

 

Thanks JJ

1 ACCEPTED SOLUTION

marcguy
ServiceNow Employee
ServiceNow Employee

very simple example, if phase is closed or withdrawn, then set state to closed:


condition: current.phase_state.changesTo('closed') || current.phase_state.changesTo('withdrawn')


script:



current.active=false;


if (current.phase_state.changesTo('closed'))


{current.state = 3;}


  if (current.phase_state.changesTo('withdrawn'))


  {current.state = 7;}


View solution in original post

11 REPLIES 11

Mguy did you do this on After or before? Insert or Update



Thanks JJ


marcguy
ServiceNow Employee
ServiceNow Employee

before update.