Pull sys_ids from selected records in a list via UI action

JJG
Kilo Guru

I have a List Banner Button UI action, and I would like it to pull each individual sys_id from the records that the user selects. (See Below)

find_real_file.png

What should the script look like for this UI action? I need to pull each sys_id individually (Once I figure out how to do this I will be using the sys_ids for GlideRecords, but for now I just want to be able to pull the selected records sys_id)

3 REPLIES 3

Erik Stolberg
Tera Guru

The UI Action will run for each row individually. "Current" is the object available for each record, so current.sys_id will get you the selected row's ID.

Rajesh Chopade
Kilo Expert

you can get selected records 'sys id' using g_list.getChecked()

var selSysIds = g_list.getChecked();

var sysIdList = selSysIds.split(',');
alert('status - '+selSysIds);

for (var i=0;i<=sysIdList.length;i++)
{
alert('i is '+i);
alert('sys id is '+sysIdList[i]);
}

 

please let me know if its helpful or need more help!

Hi, 

The client checkbox should be checked? 

I try to use the g_list.getChecked() with client=true or client=false. 
without any sucssess.