insert value with Busines Rule

Rafael Batistot
Tera Sage

Hi Team

i have this simple code with Business Rule. This rule it's running in incident table

i want to when i open any incident record number of incident needs to be inserted in this field "u_activity_2"

But it's not can be like display, needs to be modification with this symbol because if i take an report this value will be there 

RafaelBatistot_0-1743198588498.png

 

I need to do it with BR not Client Script 
 

(function executeRule(current, previous /*null when async*/ ) {
    var incidentId = current.number;
	current.u_activity_2 = current.number;
})(current, previous);

 

Thank's advanced

10 REPLIES 10

Rohit  Singh
Mega Sage

Hi @Rafael Batistot 

 

Just make your BR as before and on insert with the same code. You can remove 1st line of code var incident I’d = current.number;

 

If my response helped, then please accept the solution and hit thumbs up. This will help me and future readers.

 

Regards,

Rohit

 

 

hi, thank you for your answer, but what part of this code that you sent, will be populate the field 

u_activity_2? 

Hi @Rafael Batistot ,

 

The below code. Which you already have. Just remove the one which is mentioned above this. Please try and let me know if it helped.

 

current.u_activity_2 = current.number;

 

RafaelBatistot_0-1743200143869.png



RafaelBatistot_1-1743200166748.png

 

RafaelBatistot_2-1743200183225.png



RafaelBatistot_3-1743200245733.png