Skip to content

Instantly share code, notes, and snippets.

@afaulkinberry
Last active August 29, 2015 14:26
Show Gist options
  • Save afaulkinberry/c4e4f27944f54c87e46e to your computer and use it in GitHub Desktop.
Save afaulkinberry/c4e4f27944f54c87e46e to your computer and use it in GitHub Desktop.
ServiceNow - GlideDialogs
//Opens dialog window container - Table Form View
function newGDF(tableName, sysID, disVal){
var dialog = new GlideDialogForm('View User', tableName);
dialog.setTitle(disVal);
dialog.setSysID(sysID);
dialog.addParm('sysparm_view', 'sys_popup');
dialog.addParm('sysparm_form_only', 'true');
dialog.render();
}
newGDF('sys_user', '77433c8637ed0e40a457085a43990e39', 'Adam Faulkinberry user information');
//Opens dialog window container - UI Page
function newGDW(pageName){
var dialog = new GlideDialogWindow(pageName);
dialog.setTitle("Window Title Here");
dialog.render();
}
newGDW('sys_user');
//Opens dialog window container - Table List View
function() {
var tableName = "incident_list";
//Initialize the GlideDialogWindow
var dialog = new GlideDialogWindow('display_' + tableName);
dialog.setTitle('Incidents Assigned to Me');
dialog.setPreference('table', tableName);
dialog.setPreference('sysparm_view', 'default');
//Set the table to display
var query = 'active=true^assigned_to=javascript:gs.getUserID()';
dialog.setPreference('sysparm_query', query);
//Open the dialog window
dialog.render();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment