Displaying an info message at the top of the page the user is redirected to after the Record Produce
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2023 07:52 PM
Hi everyone, how are you?!
I have a “Record Producer” that I am using in the Portal, it is generating the Record with Attachment in the Table, but I am trying to use gs.addInfoMessage("File sent successfully!!!"), but this is not working, the message does not appear at the top of the page.
Script of Record Producer:
gs.addInfoMessage('File sent successfully!!!');
producer.portal_redirect = "test_portal?id=test_homepage";
(Example Attached 1)
Obs.: Sometimes, when I submitted the form, the message appeared at the top of the page, but then it did not appear anymore. (Example Attached 2)
Please, could anyone help me with any tips to be used within Record Producer?
Thanks 😃
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2023 02:03 PM
Hello @Elton2, I am curious what version you are on? We just upgraded from Tokyo Patch 4 to Utah Patch 4 and this is no longer working for us.
Our record producer script has this:
var s = 'Your issue has been reported. The IT Service Desk will contact you if they need more information. Thank you!';
gs.addInfoMessage(s);
I also tried with my PDI (Utah Patch 4) and it did not work there. I used the OOB "Report Outage" record producer. When I submitted it, I got a generic info message (INC0010038: Predicted Business Application Services for Service) rather than the one in the record producer script. This is the code for that record producer:
var s = 'This incident was opened for your request<br/>';
s += 'The IT department will contact you if they need any further information<br/>';
if (isMobile)
s += 'You can track status from this <a href="' + link + '">List</a> <br/>';
else
s += 'You can track status from the <a href="' + link + '">Homepage</a> <br/>';
gs.addInfoMessage(s);
I'm trying to figure out if it is a bug with Utah, or if it's something we need to update (we do have several customizations to the service portal). So, if you confirm that you are on Utah, it will help with my research. Thank you.
Susan Williams, Lexmark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2023 02:15 PM
Well, I figured it out shortly after I posted my last reply.
In the record producer script, I updated this:
var s = 'Your issue has been reported. The IT Service Desk will contact you if they need more information. Thank you!';
gs.addInfoMessage(s);
to this:
var s = 'Your issue has been reported. The IT Service Desk will contact you if they need more information. Thank you!';
gs.addInfoMessage(
gs.getMessage(s)
);
Screenshot:
I hope this helps!
Susan Williams, Lexmark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2023 05:14 AM
Hi @SusanWinKY
I am using the UTAH version, but as the gsInfoMessage("") was not showing, we decided to redirect the user to another page informing that the "Form Was Submitted Successfully!" Obs.: The URL of the redirected page was inserted in the Record Producer itself.
Example: In Record Producer Script (Script):
producer.portal_redirect = "test_portal?id=test_homepage";
Example: Below Record Producer (Catalog Client Script - tab) you have the possibility to change to OnSubmit and use a function:
function onSubmit() {
if (this.document.getElementsByClassName('get-attachment').length == 0) {
g_form.addErrorMessage(getMessage(“Please attach file
'));
return false;
} else if(this.document.getElementsByClassName('get-attachment').length > 0){
g_form.addInfoMessage(getMessage(“File attached successfully!'));
}
I hope I've helped!