Display Form Info Message on GlideDialogForm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2016 06:02 AM
I'm attempting to replace a UI Action that current redirects to a new page to create a new record to instead use GlideDialogForm. One of the current 'features' of this UI action is to add some info to a message at the top of the new record form. Is there a way to add an info message to the top of the GlideDialogForm window? I tried the below using setLoadCallback, but the infoMessage shows up on the record in the background, not the dialog.
var dialog = new GlideDialogForm('Add Change Task', 'change_task', weDone);
dialog.setSysID('-1'); //Pass in -1 to create a new record
dialog.addParm('sysparm_view', 'default'); //Specify a form view
dialog.addParm('sysparm_form_only', 'true'); //Remove related lists
dialog.setLoadCallback(formLoaded());
dialog.render(); //Open the dialog
function weDone() {
}
function formLoaded() {
g_form.addInfoMessage('Here we are');
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2016 06:34 AM
Hi Chris,
You could try using an annotation at the top of the form and then use a client script to show/hide it only when it shows up on the form, or use a display business rule to add an infomessage. I think the difficult part will be restricting it to where it only shows up in your GDW.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2016 06:57 AM
Yeah, I thought about that, and believe it would work. I was just hoping I could figure out a way to keep the code in one place rather than have all those separate pieces.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2016 07:00 AM
One other thing you could try would be to create a new view that was almost identical to the default view, but had a form annotation at the top. Then you could call that view from this code and not have to write any other code that shows and hides the message. The downside would be that you would have to remember to maintain that view whenever your default view changes.