get g_list.getChecked() in server side part of UI action

techies
Kilo Expert

Hi all,

I have a List choice UI action that utilizes both client and server side code.

I want to be able to get the chosen records in the server side code but g_list.getChecked() does not work server side. How can I achieve this?

Thanks for any help.

1 ACCEPTED SOLUTION
12 REPLIES 12

swati38
Tera Expert

Hi Roni,



g_list.getChecked() is a client side method.


This method will get you the sys_id of the checked items.


and you can pass this to server using glideAjax()


eg:


tblName = g_list.getTableName();


      selSysIds = g_list.getChecked();


      sysIdList = selSysIds.split(',');


      numSel = sysIdList.length;


     


      if(numSel > 0) {


              indx = 0;


              ajaxHelper = new GlideAjax('DeleteRecordAjax');


              getCascadeDeleteTables();


      }



Thanks,


Swati


Hi Swati,


      I have a similar kind of requirement to select list of records using checkboxes in an UI action. But I was trying the g_list.getChecked() in a scoped application. It's not working. Can you please enlighten me in this context whether the API will or won't work in scoped environment.




The following link is the OOB code, which I have to recreate in a scoped environment



https://YOURINSTANCENAME.service-now.com/nav_to.do?uri=/sys_ui_action.do%3Fsys_id%3D15683d2c0b0b2200...




Thanks in advance



Regards.


Jagadeesh


Kalaiarasan Pus
Giga Sage

This just missed becoming a classic.


Only if this question was asked by Deepa Srivastava, this would had been ultimate


Kalai



In what context was this?



Regards,


Shloke


Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Srivastava asked and Srivastava's resolved One big happy Srivastava family