Redirect a record producer

pramodkumar
Tera Expert

Hi All,

we have a record producer which creates record in scoped table. The requirement is after a user submits it first time whenever user opens record producer form again it should redirect to the record already submitted. The idea here is to allow only one submission per user

How can we achieve this?

 

Thank you!

3 REPLIES 3

SanjivMeher
Kilo Patron
Kilo Patron

You will need an onLoad catalog client script to first check if a record exists.

If yes, in the same client script use window.location to navigate to the record

window.location="<tablename>.do?sys_id=<sysid>"


Please mark this response as correct or helpful if it assisted you with your question.

Tony Chatfield1
Kilo Patron

Hi, I would try adding the target record sys_id to client session data with an after insert BR, to identify when a user should be redirected. And then an onload client-script (for the record producer) to check if this value is populated, if it use the sys_id in a redirect url (but first clear the session value).

Server Scoped API | ServiceNow Developers

Client Side API | ServiceNow Developers

ServicePortal - How to redirect to page / Catalog ... - ServiceNow Community

swathisarang98
Giga Sage
Giga Sage

Hi @pramodkumar ,

 

Please refer the below article where user has done something similar,

https://www.servicenow.com/community/developer-forum/restrict-a-catalog-item-to-just-one-time-reques... 

 

Please mark this comment as Correct Answer/Helpful if it helped you.

Regards,

Swathi Sarang