function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Steve Berley [Left Propeller]Steve Berley [Left Propeller] 

determine if the system changed field value

I've got a requirement to handle a situation one way if a user changed a field and another way if it was changed by an automated process.  By automated process I mean anything other than a user on a keyboard (apex, batch apex, trigger, wfr, flow, process builder - you name it.).

I'm actually quite flexible on how I determine it - the challenge here is being accurate and scalable.

Thanks,
Aniket Malvankar 10Aniket Malvankar 10
Dear Steve,

Create a trigger on your object. event would be before insert, After insert.

Thanks
Aniket
Steve Berley [Left Propeller]Steve Berley [Left Propeller]
I'm sorry - you lost me. How will I be able to determine in the trigger if the value was changed by a person or a wfr?
Aniket Malvankar 10Aniket Malvankar 10
Dear Steve,

If anything is changed/modified, it is gong to SAVED. 
Once you have create a tigger you can capture the event.
Please go thro'; this link - How to create a triggers.
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_qs_trigger.htm

Thanks
Aniket
EldonEldon
Hi steve just write a trigger and check if it is changed by user using userinfo class (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_userinfo.htm) . Trigger and class run as system mode.