How to get the selected record field values in LIst UI action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-22-2018 05:56 AM
HI There!
I need to create a List UI action button for doing the below activity.
1. I should be able to compare all the selected records for thier delivery location, if the selected records have same location, then i should display error message.
2. I have achieved till getting the selected records sys id using g_list.checked(). But am trying to query that record using glideRecord method which is not working.
I have written the below client checked UI action. Please help me in with this and what needs to be done for this.
selSysIds = g_list.getChecked();
sysIdList = selSysIds.split(',');
alert('status - '+selSysIds);
for (var i=0;i<=sysIdList.length;i++)
{
alert('i is '+i);
alert('sys id is '+sysIdList[i]);
var a = "'"+sysIdList[i]+"'";
alert('a is '+a);
var gr = new GlideRecord('proc_po_item');
gr.addQuery('sys_id',a);
gr.query();
gs.addInfoMessage('rec ret '+gr.getRowCount());
if(gr.next()){
gs.addInfoMessage('no is '+gr.number);
}
}
if(typeof window == 'undefined')
serverReopen();
function serverReopen(){
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-22-2018 06:01 AM
Hi,
Use gr.addQuery('sys_id','IN',a);
Thanks,
Ashutosh Munot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-22-2018 09:31 AM
Hi Ashutosh,
Its not working..still the same..

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-22-2018 11:03 AM
Try this:
gr.addQuery('sys_id',sysIdList[i]); And remove a
Thanks,
Ashutosh Munot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2018 02:00 AM
Thanks for your suggestion. I have just written a Script include in UI action and am ale to achieve it.
Thanks.