SYS Is not in query ?

sukran
Mega Sage

In Server side background script how to query glide record ... Sys Id is not ..

Below query is not working

var rec = incident.sys_id ( stored incident sysid records)

addQuery('sys_id , '!=', rec);

 

ANY IDEA

1 ACCEPTED SOLUTION

James Chun
Kilo Patron

Hi @sukran,

 

Use the following query instead:

addEncodedQuery('sys_idNOT IN'+rec);

 

I am assuming the 'rec' variable is an array which stores the sys_ids.

 

Cheers

View solution in original post

11 REPLIES 11

AshishKM
Kilo Patron
Kilo Patron

Hi, 

Refer the other's reply, you can update the addQuery() as below.

 

var rec = incident.sys_id ( stored incident sysid records)

addQuery('sys_id' , '!=', rec);

 

 

-Thanks,
AshishKM


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

Mark Roethof
Tera Patron
Tera Patron

And do post more of your script. Now we cannot assist in if you actually made a different error. What you shared now, should be fine. Though apparently its not 🙂

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn