- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2020 08:16 PM
Hi everyone,
I have a scenario where I need to bypass a query Business Rule on a table. But all other business rule should work normally on update. Is it possible to bypass query Business Rule? I have used something like this
Operation done from another table
var gr = new GlideRecord('table');
gr.addQuery(<query>);
gr.setWorkflow(false);
gr.query();
if(gr.next())
{
gr.setWorkflow(true);
gr.setValue('state','3');
gr.update();
}
Will the above code work just to bypass Query Business Rule but all other business rule to work on update?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2020 10:26 AM
Have achieved using Script action by event fired from Business rule. Thanks!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2020 08:35 PM
Hi Adheshwar
solved the problem by setting the reference qualifier on the variable to "activeANYTHING". Inside the "User Query" business rule I do something similar to:
var query = current.getEncodedQuery()
if( gs.getSession().isInteractive() && !query.includes('activeANYTHING') )
current.addActiveQuery()
also refer the following thread it might help you.
Kindly Mark helpful and correct if it works.
Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2020 08:50 PM
whats the use case ? only possible solution i can see by using gs.isInteractive() method which you need to use in query business rule.
eg:
You have query br like below.
if(gs.isInteractive()){
var u = gs.getUserID();
current.addQuery("caller_id", u);
}
now if you will run updated operation using below code then it will work and update it.
var gr = new GlideRecord('incident');
gr.get('7d95a0ab2f5e5c50f68d5ff62799b6a2');
gr.short_description = 'hey harshvardhan';
gr.update();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2020 10:26 AM
Have achieved using Script action by event fired from Business rule. Thanks!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2021 07:26 AM
can you elaborate on what you did