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 02:53 PM
This will work. But James wanted it after submit.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2016 04:14 PM
I assume by "after submit" you mean after the form is submitted and reloads?
You could used an onLoad Client Script or a display Business Rule. Assuming the value of your Draft state is 1:
onLoad Client Script:
function onLoad() {
if (g_form.getValue('state') == '1')
g_form.addInfoMessage('User message here.');
}
Business Rule:
Advanced: true
When: display
Condition: current.state == 1
Script:
gs.addInfoMessage('User message here.');