Prevent catalog form to redirect into a new URL from service portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2024 07:44 AM
Hello Community,
I did some validation for catalog from using client script and script include and its is throwing some validation message as expected but the issue is although its showing message It is redirecting to different URL on submitting the form.
How can we prevent it from navigating to different URL and force it to stay on the same catalog form page where the validation message was shown from service portal. I used return statement but still its redirecting to a different url .Kindly help here.
It is taking me to the ritm window.I deally I want to stay on the same form .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2024 08:23 AM
Hi @Sajal Chatterje ,
In the record producer script you can use portal_redirect to redirect to a specific service portal page.
producer.portal_redirect = "sp?id=sc_home"
For more information, please refer to https://docs.servicenow.com/bundle/washingtondc-servicenow-platform/page/product/service-catalog-man...
By doing so you help other community members find resolved questions which may relate to an issue they're having
Thanks,
Astik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2024 06:19 AM
Hello @Astik Thombare ,
The form that I'm using is not a record producer. It is a service request having approvals, task etc. Let me know how it is going to work in that case.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2024 04:02 AM
I think what you actually need is asynchronous validation:
If the validation fails, show an error message and stay on the form. You simply need to "return false;" instead of "return;".
Let us know if you need help with the asynchronous part.