If the field was updated by a business rule, the scheduled job cannot override it?

Neha Maurya
Tera Contributor

Please help how I can ensure if the field was updated by a business rule, the scheduled job cannot override it?

 

I have found this somewhere-
Use a Before Update Business Rule
 create a Before Update business rule to prevent overwriting:
• Table: Select the target table
• When to Run: Before Update
• Condition: current.your_field.changes() && previous.your_field != ''
This ensures that if the field was updated by a business rule, the scheduled job cannot override it.

 

Please confirm, if anybody has already used it before? or is there any other or better way to achieve it.

 

2 ACCEPTED SOLUTIONS

Hello @Neha Maurya 

 

Yes it will work. It will stop all updates in the system, once value is fixed, it will be fixed. If you want to change it agian, you will have to deactivate the BR, as also mentioned by me in first response, then we somehow got to other solutions and now back to this. 

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY

View solution in original post

Shivalika
Mega Sage

Hello @Neha Maurya 

 

Please confirm if you checked my answer. Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for my efforts and also it can move from unsolved bucket to solved bucket. 

 

Regards, 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeE

 

View solution in original post

10 REPLIES 10

Ankur Bawiskar
Tera Patron
Tera Patron

@Neha Maurya 

what's your exact business requirement here?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

OlaN
Giga Sage
Giga Sage

Hi,

In general terms, you can always overwrite a value, even when you create a business rule that checks and stops the processing during some given conditions.

This is due to the fact that you can select to disregard business rules when running a script.

 

What is it you need help to do ?

Shivalika
Mega Sage

Hello @Neha Maurya 

 

Not only for Scheduled jobs, it will not allow change when anyone updates it. Maybe add some more conditions to be specific such that it won't restrict updates by general users as well. 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY

Neha Maurya
Tera Contributor

We have a CSDM Synch job, which overwrites the support group values which gets populated from the business rule, which we are aiming to stop by modifying the Business rule, so that once the value gets populated by business rule, the scheduled job is not able to overwrite it.