How can we disable SUBMIT button on Service portal and ITIL view when we select particular value on catalog variable on a catalog item

Venkat141
Tera Contributor

How can we disable submit button on Service Portal view as well as ITIL view when we select Particular value under catalog variable on the catalog form

 

@Ankur Bawiskar 

@Saurav 

@shloke04 

@Anil Lande 

@Maik Skoddow 

@Jaspal Singh 

@Sandeep Dutta 

@Chandra Sekhar Maganty 

@Musab Rasheed

12 REPLIES 12

Hi @Pavan Ramireddy 

This is happening because you're using an asynchronous call to the server and the client script isn't waiting for a response to come back.  While this is best practice, it simply won't work in an 'onSubmit' script for validation because the submit happens and redirects without waiting. 

You need to follow the suggestion provided in the community thread below:

https://community.servicenow.com/community?id=community_question&sys_id=7eee47a1dbdcdbc01dcaf3231f961958

https://snprotips.com/blog/2018/10/19/synchronous-lite-onsubmit-catalogclient-scripts

This should work for you..

Another approach here can be as mentioned below:

1) Create a Hidden Variable of type checkbox say and based on your conditions update the hidden variable using a On Change Catalog Client Script and now based on this variable value write a On Submit Catalog client script and that should also work here.

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Murthy Ch
Giga Sage

Hi,

Here is the good Article. I usually follow this one

 

Thanks,

Murthy

 

Thanks,
Murthy

shloke04
Kilo Patron

@Pavan Ramireddy 

Great to see that my response helped you and has been marked as helpful. If your query is resolved please mark the answer as correct and close this thread for others.

Regards,

Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke