- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2019 06:00 AM
Hey. I have a before Query Business Rule that runs on all tables extending from Task [task]. It provides Company separation for us. However, I don't want it to apply to a custom table called Order [u_order] that extends from task. Here is the rule:
The code:
function onBefore(current, previous) {
var userCurrentCompany = gs.getUser().getCompanyID(),
dotWalkPath = 'u_customer.company',
dotWalkPathOr = '^ORu_customer.company=NULL';
if (userCurrentCompany != '') {
current.addEncodedQuery(dotWalkPath + "=" + userCurrentCompany + dotWalkPathOr);
} else current.addDomainQuery("global");
}
I've tried to add a condition using the condition builder: Task type is not Order. This doesn't work. I also tried adding the following query to the end of the Condition: && sys_class_name!=u_order but this also didn't work. Any ideas?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2019 09:08 AM
Try this
gs.getSession().isInteractive() && !gs.hasRole("admin") && current.getTableName() !='u_order'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2019 06:12 AM
You can add a condition
current.sys_class_name !='u_order'
Please mark my answer correct/helpful if it solves your issue.
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2019 07:35 AM
Hey Wayne,
This Worked??
-A
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2019 08:53 AM
Hey, thanks for the reply, but sadly it didn't work. Just to confirm, I added it to the existing condition like so:
gs.getSession().isInteractive() && !gs.hasRole("admin") && current.sys_class_name!='u_order'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2019 09:08 AM
Try this
gs.getSession().isInteractive() && !gs.hasRole("admin") && current.getTableName() !='u_order'