Can a Business Rule be limited to only certain extended tables?

MBarrott
Mega Sage

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?

2 REPLIES 2

Alex Rose
Tera Guru

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
}​

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.