Business rule not working after setUseEngines(false);

Dotychczas
Mega Guru

Hi Experts!

 

I'm working on fix script that will set one field on interaction record:

}else{
			grReq.setValue(field, genericUserId); 
			new global.SsgMdcGlobalApiFunctions().setUseEngines(grReq, false);
			grReq.update();

		}

as there is RO data policy I managed to update this field using setUseEngines() method that is run from global script include. Record updates fine but there is also business rule that should run on update ( rest of conditions is fullfiled) but it doesn't. I suspect that serUseEngines(false) is responsible. How can I workaround so business rule will work and I can override data policy at the same time?

1 ACCEPTED SOLUTION

Laszlo Balla
ServiceNow Employee
ServiceNow Employee

Is it a specific BR you need to run or just (update) BRs in general? If it is just one or two, perhaps you could just run he same functionality in your fix script then?

Alternatively... turn setUseEngines back on and run another update?

View solution in original post

5 REPLIES 5

Rajesh Mushke
Mega Sage

Hi @Dotychczas ,

 

You can use the setWorkFlow(false) to stop running any scripts while updating the data using the fix scripts. Let me know if you need any help!



Thanks,
Rajashekhar Mushke
Rising star : 2022 - 2024
Community Leader -2018
Connect me on LinkedIn : Rajashekhar Mushke

Are you sure that you responded in correct question? I turned off data policies using setUseEngines(false); Now I wonder how to make business rules run again.

Laszlo Balla
ServiceNow Employee
ServiceNow Employee

Why don't you move all updates of the grReq GlideRecord to the script include, so in the BR you would just call the global SI and not attempt to do both?

Its in fix script. I just wanted to quickly update all needed records and not leave anything in SI.