
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-09-2018 03:43 PM
Can someone help me troubleshoot the following business rule? I use gs.isInteractive() to make sure that it runs when the user logs in the platform but not when in a non-interactive session. But it does run when the user submits a request and the log statement shows "gs.isInteractive(): true".
By the way, it's on Kingston.
Befrore query table sc_req_item.
(function executeRule(current, previous /*null when async*/) {
gs.log('gs.isInteractive():' + gs.isInteractive());
if (!gs.isInteractive()) {
gs.log('!gs.isInteractive():' + !gs.isInteractive());
return;
}
// do some processing here
})(current, previous);
Any help would be much appreciated.
Joy
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-13-2018 06:15 PM
Please close the thread by marking my response correct if it worked for you
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-09-2018 04:52 PM
So that's a UI. So it will always return true.
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-09-2018 05:00 PM
Thank you. That's good to know.
I've got another question for you. When submitting a request, why it queries the RITM table so the before query BR got triggered? Isn't it just an insert?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-09-2018 05:11 PM
Before BR always gets triggered on update or insert, because it has to show the request created to the user the record post submission.
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-10-2018 08:57 AM
Thank you very much. That's what I suspected. Is there any way to tell the difference between post submission query and straight query?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-10-2018 09:33 AM
They are part of regular UI interaction of Service-now with Database. If you create a record, it will query database to show it back to you.
If you directly query a table, thats a straight query.
Please mark this response as correct or helpful if it assisted you with your question.