- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2025 10:21 PM
Hey Folks,
I need help with creating union of condition, I have a relationships(Related List) on incident table which have criteria something like below:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2025 03:58 AM
Hey @Ankur Bawiskar , I could not get that to work however I tried realigning of query and that helped reduce the timing, so new criteria looks something like below, this brought down timing to 1/3rd:
current.addEncodedQuery( 'sys_id!=' + parent.sys_id + '^sys_created_onONLast 60 days@javascript:gs.beginningOfLast60Days()@javascript:gs.endOfLast60Days()' + ('caller_id=' + parent.caller_id + '^ORu_behalf_of=' + parent.caller_id + '^ORcaller_id=' + parent.u_behalf_of + '^ORu_behalf_of=' + parent.u_behalf_of ));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2025 10:44 PM
I just updated the above script
Note: I haven't tested it, please test it in background script
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2025 12:50 AM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2025 03:58 AM
Hey @Ankur Bawiskar , I could not get that to work however I tried realigning of query and that helped reduce the timing, so new criteria looks something like below, this brought down timing to 1/3rd:
current.addEncodedQuery( 'sys_id!=' + parent.sys_id + '^sys_created_onONLast 60 days@javascript:gs.beginningOfLast60Days()@javascript:gs.endOfLast60Days()' + ('caller_id=' + parent.caller_id + '^ORu_behalf_of=' + parent.caller_id + '^ORcaller_id=' + parent.u_behalf_of + '^ORu_behalf_of=' + parent.u_behalf_of ));