addquery Glide Record with a list

arb
Tera Contributor

I'm trying to run a query on the incident_sla view.

What I'm trying to do is return all regions that match a particular value i.e Southwest.

The problem is that DOT walking seems to fail me now,   where it succeeded before on reference fields that point to a string   it fails when it points to a string that is type LIST

The issue seems that my nc_u_region_ids.u_region_name actually points to a data type of LIST

column label   column name     type       reference

Region IDs

u_region_ids

List

Region IDs

Is there any way to effectively query on a List?

Below is what I'm trying to accomplish in this pseudo method

  1. gr.addQuery("inc_u_region_ids.getDisplayValue()", "Southwest");

    Or
  2. gr.addQuery("inc_u_region_ids.u_region_name", "Southwest");
5 REPLIES 5

sachin_namjoshi
Kilo Patron
Kilo Patron

Please use below sample code to query glide list variables for business rule



var proj = new GlideRecord('pm_project');


//proj.addQuery('u_idea',current.sys_id);// add your code


proj.query();


while(proj.next()){



var list = current.u_users.getDisplayValue();


var array = list.split(",");


for (var i=0; i < array.length; i++) {


//gs.print("Reference value is: " + array[i]);


if (proj.watch_list =   array[i]{



// add your code



}


}



Regards,


Sachin