Query business rules on child table is not applying to Parent table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2023 08:45 AM
Hi, I've written a query business rule on child table, but records are still visible on parent table, But when trying to open records, it is showing as record not found,
How to fix this issue.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2023 08:57 AM
Hello @Chaiatnya
In my opinion this is not issue , thats the way it works.
Even product documentation says the same in 'points to consider'
It is recommended to have before query BR on lowest hierarchy meaning if you want to restrict incidents then you are not supposed to create before query BR on task but on incident itself , and I believe you have done that.
Now the part when you are looking into incident records from task table, then query BR isnt executed but gets executed when user tries to open incident and user gets 'Record not found'.
In such cases consider this as side effect of before BR from child table but if you still want to get rid of this behaviour then you can think of another before query BR on task table and just filter out incidents from it (using current.getTableName()!='incident').
Regards,Sushant Malsure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2023 09:35 AM
@sushantmalsure Hi, Thanks! I've written on task table now, but the condition applied to all the child tables. For example i'm not able to see Request items assigned to some one. I only need to restrict for Incidents, Not other child tables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2023 09:44 AM
Can you share the script from task which you have written?
I just tried before query BR on task and added following in script
Regards,Sushant Malsure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2023 09:47 AM
Hi @Chaiatnya
There are a few reasons why a query business rule on a child table might not be applying to the parent table.
- The query business rule might not be scoped to the parent table.
- The query business rule might be using a filter that is not compatible with the parent table.
- The query business rule might be using a join condition that is not compatible with the parent table.
To troubleshoot this issue, you can use the following steps:
- Check the scope of the query business rule. The scope of the query business rule should be set to the parent table.
- Check the filters used in the query business rule. The filters used in the query business rule should be compatible with the parent table.
- Check the join conditions used in the query business rule. The join conditions used in the query business rule should be compatible with the parent table.