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
ABC XYZ 39ABC XYZ 39 

How to get LastModifiedBy Value in Trigger

Hi, I need to insert only those records in a custom object using after update trigger, where the lastModifiedBy User is not 'User X'
Thanks
JethaJetha
We have LastModifiedById field on every standard and custom field, if you know the username by salesforce Id, you can simply compare is 18/15 digit Id with LastModifiedById or you can query on User object and get the user Id by username or whatever and then compare.