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

Robert H
Mega Sage

Hello Rafael,

 

First of all, why would you want to populate a field with the same value that is already present in another field (Number)? What is the exact business requirement?

 

The solutions pointed out by the others should work fine. You can even create that Business Rule without scripting (replace "Description" in my example with your custom field):

RobertH_0-1743236276323.png

 

Also, what is the data type of this "Activity 2" field? Is it a string or a journal field?

 

Regards,

Robert