0
In the code below I used the variable AccountId
to obtain the account with the name "Integration AWS"
, but I need the consultation to not take accounts that were changed by "Integration AWS"
.
How can I do on the consultation part "Account. LastModifiedById =: AccountId"
not to leave the hard code "Account. LastModifiedById <> '0002265448786545'
?
Id AccountId = Schema.SObjectType.User.getRecordTypeInfosByDeveloperName().get('Integration AWS').getRecordTypeId();
public void executeLog() {
for(AccountHistory event: [SELECT Account.CPF__c, Account.Name, Field, OldValue, NewValue, CreatedDate, Account.RecordTypeId
FROM AccountHistory
WHERE CreatedDate = Today And Account.RecordTypeId =: recordTypePersonAccount And Account.LastModifiedById =: AccountId]) {
generateLog(event);
}