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.

Omit edit condition

amaneet
Kilo Contributor

Hi Folks,

I have change requests related list on release form. I want edit button on related list to be visible only when the release is in draft state.

I have written script in omit edit button as follows but its not working as intended!

answer=true;

if (parent.state == -4 );

{answer=false;}

Any pointers please?

1 ACCEPTED SOLUTION

Harsh Vardhan
Giga Patron

answer=true;


if (parent.state == '-4' );


{answer=false;}



try now


View solution in original post

3 REPLIES 3

Harsh Vardhan
Giga Patron

answer=true;


if (parent.state == '-4' );


{answer=false;}



try now


sb1186
Kilo Guru

Hi Amaneet,



Your script looks fine, however, you can re-check a couple of things:



1) OOB the value of the Draft state on rm_release is -5, whereas you are using -4 in your condition.


find_real_file.png



2) Ensure that you have not checked the Omit edit button checkbox while you are using this script.


find_real_file.png


Once you have ensured the above, the below script should help you achieve your expected results.



if (parent.state == '-5' )


{


  answer = false;         // If Release state is Draft, returns false for omitting Edit button


}


else


  {


  answer = true;


  }



Hope this helps. Let me know if you have further queries.



PS: Mark this answer as Correct if it solved your query or hit Like/Helpful depending upon the usefulness of the response.



Regards


Supriya Bisht