I have a custom checkbox field.
I need to know how to identify the last user that changed the custom checkbox field by using an apex code.
Is it possible? If so, how?
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
You can also create a new custom field, type = lookup to User, and set value to that lookup field only when somebody will be editing Your custom checkbox. That can be easily done in trigger, let me know if You need support with that.
It is not as straightforward solution like Adrian Larson gave to You, but Yu can save SOQL with that approach. Everyting depends what You need.
Just query for it.
List<CustomField> fields = [ SELECT DeveloperName, LastModifiedBy.Name, LastModifiedDate FROM CustomField WHERE ... ];