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:17 PM
Below query translates into what you have stated in text
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:32 PM - edited 10-27-2022 11:33 PM
Hello,
Please use the below:-
addEncodedQuery('numberLIKE'+number+'^stateIN3,4,7,110^NQnumberNOT LIKE'+number);
Please mark my answer as correct based on Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 11:35 PM
Hi
Showing the below error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 11:38 PM
There is a + missing use below:-
addEncodedQuery('numberLIKE'+number+'^stateIN3,4,7,110^NQnumberNOT LIKE'+number);
Please mark my answer as correct based on Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2022 12:09 AM
Not sure why when I pass any open /WIP/pend ticket that time also comes in this loop that's the problem.
Are they any other way to add an OR condition at last something like below?
//sc_item1.addOrCondition('numberNOT LIKE'+number);