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

Shishir Srivast
Mega Sage

Hi Roni,



g_list is Client-side Glide APIs, http://wiki.servicenow.com/index.php?title=GlideList2_(g_list)#gsc.tab=0, which allows you to to create scripts to run in browser, I don't think you should be able to use the same on server side scripting.


What are you trying to do? Are your getting value from server side and then trying to pass to client. Not sure if that works.



But you should be able to achieve this using GlideAjax. You can do GlideAjax to get the record and then take appropriate action on client side.



Reference: UI Action: Can I pass a value from the client function to the server function?



Hope this helps.


shloke04
Kilo Patron

Hi,



Can you elaborate your requirement on exactly what needs to be achieved?



Regards,


Shloke


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

Regards,
Shloke

Hi,


I am trying to duplicate a record once the ui action is pressed. But since I can't access the current variable in a client script I can't simply send the sysID of the current record and the selected elements to glideAjax. So how can this be done?