- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2024 03:38 AM - edited 10-22-2024 03:39 AM
Hi Team,
I am trying to call a particular view from a ui action.
scenario :-
when I click on "On hold" ui action in incident table, i need a specific view "on_hold_dialog_view" to get displayed as a popup.
Can I know how i can call this view in Ui action
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2024 04:29 AM - edited 10-22-2024 04:29 AM
Hi @Roshini
UI Action Client checkbox should be true and onClick use openPopup() method.
I did similar requirement long back, Adding code below. Modify according to your requirement.
function openPopup() {
var tableName = ''; //table name here
var sysid = g_form.getUniqueValue();
//Create and open the dialog form
var dialog = new GlideDialogForm('Title', tableName); //Provide dialog title and table name
dialog.setSysID(sysid); //Pass in sys_id to edit existing record, -1 to create new record
dialog.addParm('sysparm_view', 'Reasons'); //Add view of the form
dialog.setLoadCallback(function(iframeDoc) {
// To get the iframe: document.defaultView in non-IE, document.parentWindow in IE
var dialogFrame = 'defaultView' in iframeDoc ? iframeDoc.defaultView : iframeDoc.parentWindow;
dialogFrame.g_form.setValue('u_number', g_form.getValue('u_number'));
dialogFrame.g_form.setValue('u_state', 'Completed');
dialogFrame.g_form.setMandatory('u_justification', true);
dialogFrame.g_form.setReadOnly('u_select_user', true);
dialogFrame.g_form.setReadOnly('u_hiring_manager', true);
dialogFrame = null;
});
dialog.render(); //Open the dialog
}
Refer Below article
https://servicenowguru.com/system-ui/glidedialogwindow-quickforms/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2024 11:23 AM - edited 10-22-2024 11:27 AM
Check the article link I provided, Create a OnLoad client script which runs only for the view you want with below logic
//Remove all buttons except for the 'Update' button
var items = $$('BUTTON').each(function(item){
if(item.id != 'sysverb_update'){
item.hide();
}
});
Make Isolate Script to false for above client script.