Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Current.update() after insert business rule

Rushi2
Tera Expert

Hi All, 

 

I have field A (currency type). While creating a record I give some value it has to copy on field B(current field).

After insert

current.b = current.A;

current.update();

is there any option without using current.update();

 

Regards, 

Rushi

5 REPLIES 5

Saurav11
Kilo Patron
Kilo Patron

Hello,

 

You can also use a before insert BR with below code;-

 

current.b = current.A;

 

OR

 

write a Onchnage client script and copy the value from field a to field b whenver field a changes.

 

Please mark my answer as correct based on Impact.

 

 

Hi Saurav,

 

current.b = current.A;   - field B is not updating value

 

Only once time it has to update. Value A will keep changing. I want to see the first value of A in B .

Is Did you change the BR to before insert and is before insert BR not working? If yes,

 

As I mentioned earlier you can maybe use onchnage client script

 

add the condition:-

 

If(g_form.getvalue('field')=='')

{

//then set the value

}

 

this way you will only set the value when field b is empty after that is will not be updated.

 

Please mark my answer as correct based on Impact.

Please post a screenshot of your BR settings.