Displaying a specific message after Record Producer submission (update) in the Service Portal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2019 10:47 AM
Hello,
I am using a catalog form to update a record on the Product table (rm_product). My form is a Record Producer form so during submit my record producer script uses this command so a new record is not generated.
current.setAbortAction(true);
But then I get directed to a page that says "No record found.". This would seem expected but very confusing to the user updating the record. I have been able to redirect the user from the page that says "No record found." by using this command.
producer.portal_redirect = 'https://' + instanceName + '.service-now.com/sp?id=sc_cat_item&sys_id=686a62521bb9b7002240a79b2d4bcb88';
However, I am still struggling in getting a message or confirmation box to appear to the user telling he/her "The Product record has been updated." gs.addInfoMessage("Record is updated."); is not working in the Service Portal and I have seen some articles talking about using spUtil.addInfoMessage("Your message"); but adding it to the catalog form widget which I don't think that I can do because the widget is used for all forms and I don't want this message appearing during other submissions. I am not aware of how to have a specific widget or instance be used for a specific record producer form if so that might be a solution.
Any other ideas?
Thank you,
-Wesley
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2024 09:35 AM
@Wesley Breshear I'm in same situation now to get info message displayed only for a specific record producer after submitting on Service Portal
Did you ever get it worked, if so How ? Thankyou

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2024 12:55 PM
Hi Naresh,
No, I was not. The Client decided it wasn't a major issue, so we canceled the story to make the message viewable. Sorry, I can't be helpful.
-Wesley
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2024 04:25 PM
I have done some similar things calling different logic depending where the user is and this is an option you can use to apply to your requirement.
Create yourself an OnLoad client script with a UI type of "All".
Create your functions in this onLoad script that you want to call.
In this instance, I needed to show a confirmation pop-up in the portal and native UI depending on where the user raised it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2019 08:48 PM
Hi Wesley,
gs.addInfoMessage should work on the catalog form widget in portal. Please try to use this code.
current.setAbortAction(true);
gs.addInfoMessage("Error message");
producer.redirect = "com.glideapp.servicecatalog_cat_item_view.do?v=1&sysparm_id=SYS_ID_OF_RECORD_PRODUCER";
This is taken from an OOB Record producer which works in both platform and portal, You could test it out in your PDI and use the same logic.
Here is its URL: https://instance_name.service-now.com/nav_to.do?uri=sc_cat_item_producer.do?sys_id=255d3c947f0000011e3d3dd191fa8795