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.

Business Rule not working on import

Akki1
Tera Contributor

I have a custom table u_accounts

fields are:

User_id

first_name

last_name

Manager-String

manger_Identity-Refernce to self table(u_accounts)---not visible on form

Manager_User_Id-String---not visible on form

 

I have written after business rule on insert/update with condition Manager_User_Id changes

var gr=new GlideRecord('u_accounts');

gr.addQuery('user_id',current.Manager_user_id);

gr.query();

if(gr.next()){

current.manger_Identity=gr.getValue('sys_id');

}

current.update();

 

It is working fine if i submit using form but it is not working when i upload data in bulk

 

 

 

6 REPLIES 6

Saurav11
Kilo Patron
Kilo Patron

Hello,

 

In the transform map please check if the run business rule checkbox is set to true.

 

Saurav11_0-1666075608146.png

 

Also make sure there are no transform script in that transform map which has the below syntax:-

 

setWorkflow(false);

 

Please mark answer correct based on Impact.

Akki1
Tera Contributor

Yes it is already true

and no transform scripts used

Your business rule condition is  Manager_User_Id changes is this getting satified form the import?

 

Also what is the when to run after insert/update or before insert/update?

Akki1
Tera Contributor

after insert/update