How can we disable SUBMIT button on Service portal and ITIL view when we select particular value on catalog variable on a catalog item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2022 04:31 AM
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
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2022 06:06 AM
Hi
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
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2022 06:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2022 03:11 AM
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
Regards,
Shloke