Closing Record Producer After Submitting

Matt Franki
Tera Contributor

Currently we have a record producer that opens from a service portal homepage. Upon clicking the Submit button, I would like the newly opened record producer window to close, set the parent (the original Service portal homapge) window as the target, and refresh that page. Any help would be great!

4 REPLIES 4

chirag_bagdai
ServiceNow Employee
ServiceNow Employee

Hi Matt,



Can you please clarify that this redirection functionality should work for all requests or specific to one record producer ?



However, for this change you need to you can create custom page which should look similar to "sc_cat_item" page except "SC Catalog Item" widget because you need to use cloned widget.



Or you can clone "SC Catalog Item" widget and replace "SC Catalog Item" widget in "sc_cat_item" page with cloned widget.



Below is the example for one record producer :



You need to clone "SC Catalog Item" widget and start below changes :



1. Server Side:


Add two lines which will check if redirection should be activated or not for one record producer.


Note: Please update   syy_id of record producer in if condition


Screen Shot 2017-06-07 at 4.42.04 AM.png


2. Goto Client controller and add $location in the function argument.


Screen Shot 2017-06-07 at 4.37.29 AM.png




3. Add else if condition as written in below screenshot which will redirect users to homepage.



Screen Shot 2017-06-07 at 4.37.19 AM.png



Let me know in-case of any question.


Just need it for this one record producer. What we are using now is not a widget though. It's a form that a user fills out. Similar to a form that you could create as a UI page but this one is created as a record producer item and editted through the the "Maintain Items" menu under Service Catalog. We don't have time to re-create the entire thing so I was hoping there was a solution using our existing record producer.


Thanks Matt,



I think, you need to do modification in Service Portal. May I know how your users will open this record producer in service portal ? like via header menu link ?


From a link in a custom widget.