Preventing System Field Updates Triggered by Business Rules in cost_plan_breakdown Script

Harish74
Tera Expert

Hello,

I'm currently working on a fix script to update records in the "cost_plan_breakdown" table, and I want to ensure that system fields are not updated during this process. To achieve this, I am using the `autoSysFields(false)` method within my fix script. I have deliberately not used `setWorkflow(false)` so that the relevant business rules are still triggered after the updates.

The `autoSysFields(false)` method is working as expected for the "GlideRecord" records that I have updated. However, there is an issue. When I update "cost_plan_breakdown" records using `autoSysFields(false),` although the system fields are not updated as intended, the relevant business rules are still triggered. Consequently, the associated cost plans, which are updated by the business rules, result in the system fields being updated under my User ID.

I want to prevent any updates from occurring under my User ID. Could you please assist me in finding a solution to this issue?

1 REPLY 1

Uncle Rob
Kilo Patron

Well, you kind of identified the main issue with that.  You don't want your main repair script to look like a legit update, but you still want business rules to process, and that processing will update the records you don't want to LOOK like an update.

Only thing I can think of is copying the same logic the business rules are doing into your fix script so the whole operation false under autoSysFields(false), but man that sounds scary.