UI Action Get Selected on Related List

kristenankeny
Tera Guru

I have the following UI action I'm attempting to use from a related list:

var selected = g_list.getChecked();

var a = new userAdministration();

a.addToITIL(selected);

g_list.refresh();

Whenever I select this UI Action from a related list, I get the following error in the log:

org.mozilla.javascript.EcmaError: "g_list" is not defined.

Caused by error in <refname> at line 1

==> 1: var selected = g_list.getChecked();

...

I see that the wiki says g_list doesn't work for related lists, but then I'm seeing in the community that people are using this for related list UI actions. Does anyone know how to resolve this? This UI Action is only needed on a related list from a group record.

1 ACCEPTED SOLUTION

Hi Arnab - thanks for pointing me in the right direction. I was able to send current.sys_id to my script include and it works.


View solution in original post

3 REPLIES 3

arnabbose
Tera Expert

Create an UI Action on the respective table and check the List Choice as True.



In Script portion write:



current.addToITIL = true;


current.update();


action.setRedirectURL("/table_name?sys_id=" +current.sys_id);


Hi Arnab,



Thanks for the suggestion, I've already created the UI Action with that selection. However, I need to send the list of selected items to a script include, which is why my UI action calls a SI. However, when I use g_list.getChecked(), I get an error.


Hi Arnab - thanks for pointing me in the right direction. I was able to send current.sys_id to my script include and it works.