How to get the selected record field values in LIst UI action

Saranya Suresh
Kilo Expert

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(){
}
}

 

 

6 REPLIES 6

Hi Can you let us know about the script include, you created and that is working? Thanks BR Dirk

Hi,

Can you please share the code of script include to achieve this