gs.addInfoMessage after submit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2016 04:45 AM
Hi Guys
Quite new to scripting, however, I have a ui action to submit the request and would like a message to appear after its submitted and when they are redirected back to say the list. I have the below which shows.
However, I have a business rule that prevents the user from attaching before submit. If they try submit without attachment, then the 'request submitted " message appears along with the invalid insert because of no attachment on the form.
I like the message to only appear after submit on appear on the list like this
Thank you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2016 04:47 AM
Hi Brendan,
Try putting the gs.addInfoMessage() after the current.update().
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2016 04:54 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2016 05:01 AM
Any chance you can copy the "attachment check" logic to your UI action and test it there before doing the current.update()? Then you could do an if/else check. Something like this:
// Pseudo code
if (attachmentsNotFound) {
gs.addErrorMessage('You need to attach your template before submitting');
} else {
gs.addInfoMessage('Your request has been submitted successfully.');
current.update();
}
action.setRedirectURL(current);