Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to create popup for specific record in list view in "Action Check Boxes"

subrata_mettle
Kilo Contributor

I can get the popup window for the specific data within the page through " g_form" object and "GlideDialogForm"

as like the snippet :

find_real_file.png

But I want to open the popup from the list view for the selected incident from the "Action Check Boxes",

problem is that I am unable to get the sys_id for the selected Incident in the list view, through "g_form" we can get the sys_id if we have open the incident page.

how to get the sys_id in this scenario, if I will get the sys_id in my UI Action Scripts then I think I will be able to show the incident data in popup window.

find_real_file.png

12 REPLIES 12

you are not calling the function



add showMyForm(); on line number 11.


i have done that already, I came to know this after posting that I didn't call the function.



But after rectifying also Menu is not showing.


Rakesh Mamidi
ServiceNow Employee
ServiceNow Employee

It seems you are looking similar to update selected ui context menu



Create a new view of your choice and render that view.



/**


* Script executed on the Client for this menu action


*


* The following variables are available to the script:


*       'g_list' the GlideList2 that the script is running against (only valid for List context menus)


*       'g_fieldName' the name of the field that the context menu is running against (only valid for List context menus)


*       'g_sysId' the sys_id of the row or form that the script is running against


*       'rowSysId' is also set to the sys_id of the row to support legacy actions, but g_sysId is preferred


*/


runContextAction();




function runContextAction() {


    var keys = g_list.getChecked();


    if (keys == '') {


          var msg = new GwtMessage().getMessage('There are no rows selected');


          alert(msg);


          return;


    }


   


    var url = new GlideURL(g_list.tableName + '_update.do');


    url.addParam('sys_action', 'sysverb_multiple_update');


    url.addParam('sysparm_multiple', 'true');


    url.addParam('sysparm_nostack', 'yes');


    url.addParam('sysparm_checked_items', 'sys_idIN' + keys);


    url.addParam('sysparm_view', g_list.getView());


   


    window.location = url.getURL();


}


Thanks MVR .. I am doing the same thing but not able to see the new menu if I do the right click on the incident no:


Can you please let me know what wrong I am doing for this.


find_real_file.png


Rakesh Mamidi
ServiceNow Employee
ServiceNow Employee

You should be seeing it in the menu, Try doing instance cache.do and re-login in a new browser .


BTW in the script you are not calling the function showMyForm()