How to query doesn't contain in glide record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 06:57 AM - edited 10-27-2022 07:06 AM
Hi All,
How to Query does not contain in glide record. Tried below but not working.
Need to query "if a particular RITM no is not available in sc_req_item"
if (emailsubject.includes("RITM")) {
subject = emailsubject;
indexStart = subject.indexOf('RITM');
number = subject.slice(indexStart, indexStart + 12);
gs.log("custmint191" + number);
var sc_item1 = new GlideRecord("sc_req_item");
//sc_item1.addEncodedQuery('number NOT LIKE number');
//sc_item1.addEncodedQuery('number DOES NOT CONTAIN number');
//sc_item1.addEncodedQuery('numberNOT LIKE' + number);
sc_item1.query();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 11:06 PM - edited 10-27-2022 11:19 PM
Hi @jobin1 ,
I have re-arranged the query. Try this one:
This translates to query RITM table and find records which either does not contains number or is not equal to number AND state is not one of closed complete/closed incomplete/closed skipped.
But this will only work if your requirement is also the same
var query = "number="+number+"^stateIN3,4,7,110"+"^ORnumberNOT LIKE"+number;
I Hope this helps.
Please mark this helpful if this helps and Accept the solution if this solves your issue.
Regards,
Kamlesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 11:21 PM
Not working other state tickets also coming in this loop like wip/open/pending
var query = "number="+number+"^ORnumberNOT LIKE"+number+"^stateIN3,4,7,110";
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 11:26 PM
@jobin1 ,
You have used the query wrong, let me re-iterate the query:
var query = "number="+number+"^stateIN3,4,7,110"+"^ORnumberNOT LIKE"+number;
Regards,
Kamlesh