In a Business Rule what should be the syntax of condition

Community Alums
Not applicable

Suppose in a business rule I want to add a condition on Advance option that it shoud only run on a particular table.
 

UTSAVJAISWAL_0-1680372776030.png

Please help me to write a code in condition field that the business rule should only run on a particular table.

Thanks
Utsav

9 REPLIES 9

SwarnadeepNandy
Mega Sage

Hi Utsav,

 

Table condition for Business Rule is not something which you put in condition field.

To make the Business Rule run on a particular table, you should specify it in the Table field on the top section of the form.

 

Screenshot 2023-04-02 at 1.08.44 AM.png

Best Regards,

Swarnadeep Nandy

 

Prince Arora
Tera Sage
Tera Sage

@Utsav JAISWAL ,

 

I hope you are doing great!

 

Actually, when we have configured the business rule, we need to select the name of the table, so business rule is working on the update/insert/delete/query of that table, PFA screenshot

 

PRINCE_ARORA_0-1680413339911.png

if still you want to add some condtions in Business rules, you can mention:

 

1) Simple condition like :

 

current.YOUR_FIELD_NAME == "YOUR_VALUE"

 

2) Also you can call script include from the condition field like:

 

new ScriptIncludeName().functionName();

 

And in the function of the script include, you can check your condition and return true/false accordingly;

 

If my answer solved your issue, please mark my answer as Correct & 👍Helpful based on the Impact.

 

 

Shraddha Kadam
Mega Sage

Hi Utsav,

 

You can add your table into the "Table" field as mentioned in the Swarnadeep Nan1 post. Also, you can add table name in the advanced section as var gr = new GlideRecord('table_name'); 

 

Could you please elaborate more to help you on the same.

 

Please mark Correct and click the Thumb up if my answer helps you solved your issue. Thanks!

 

Thank you.

If my response was helpful, please mark it as correct and helpful.
Thank you.

Community Alums
Not applicable

See I want to write a business rule with some condition in this "Condition" field.. @Shraddha Kadam 

UTSAVJAISWAL_1-1680429684372.png

Can this be possible..If yes what should be the syntax on that field, so that it can only trigger on a particular table..