Can a Business Rule be limited to only certain extended tables?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2024 09:06 AM
I have a Business Rule on the task table which I would like to also have running on extended tables such as the project_action table.
The issue is that I don't want this to be inherited by ALL tables that are an extension of the task table.
Is there a way to override or limit which extended tables inherit a Business Rule?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2024 11:11 AM
In the script body of the business rule, you can limit the tables you'd like it to run on by looking at the table name of the current record. For example, if you'd like it to run on every inherited table except table_x and table_y:
if(current.getTableName() != 'table_x' && current.getTableName() != 'table_y')
{
//BR code here
}
Conversely, if you'd only like it to run on table_x and table_y:
if(current.getTableName() == 'table_x' || current.getTableName() == 'table_y')
{
//BR code here
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2024 12:10 PM
Hi @Alex Rose
I was actually able to fix the issue by using the following condition check:
current.sys_class_name != 'tableName'
Your solution should also work so I greatly appreciate the help.