adding a message to the top of the from
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2016 01:44 PM
Hello Experts,
I have a client script that checks if the record is new and executes a message on top of the screen for users. How do I extend this client script to show the same message after submit (record is still in the same 'draft' state after submit) if it's not 'New'?
function onLoad() {
if (g_form.isNewRecord()) {
g_form.addInfoMessage('User message here.');
}
}
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2016 01:46 PM
Use onSubmit client script and and put the same script in there
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2016 01:50 PM
Hi Abhinay, I've tried that before, it did not work.
function onSubmit() {
//Type appropriate comment here, and begin script below
if (g_form.isNewRecord()) {
g_form.addInfoMessage('User message here.');
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2016 01:51 PM
Try this:
function onSubmit() {
if (!g_form.isNewRecord()) {
g_form.addInfoMessage('User message here.');
}
}
Thanks,
Farukh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2016 01:55 PM
Hi Farukh,
I just gave that a try with "!" in front of g_form - not working.