You need to sign in to do that
Don't have an account?
Gaurav Agnihotri 11
lead history
I am trying to anonymize leads. I am updating the salesforce fields and then deleting the history of the field (.
and
GDPRLeadUpdate(leadId);
GDPRLeadDeleteHistoryOption(leadId);
THere are still values in lead field history.
Any thoughts!
public static String LeadGDPRAnonymizeFieldUpdate(Lead LeadTobeUpdated) { LeadTobeUpdated.FirstName = '**********'; LeadTobeUpdated.LastName = '**********'; LeadTobeUpdated.FirstNameLocal = '**********'; LeadTobeUpdated.LastNameLocal = '**********'; LeadTobeUpdated.MobilePhone = '**********'; Return 'Success'; }
and
public static String LeadGDPRDeleteFieldHistory(List<Id> sLeadID) { List<LeadHistory> leadHistory = new List<sObject> (); leadHistory.addAll([SELECT Id FROM LeadHistory WHERE LeadId IN :sLeadID]); Database.delete(leadHistory); return 'Success'; }When I call these functions in the main fuction:
GDPRLeadUpdate(leadId);
GDPRLeadDeleteHistoryOption(leadId);
THere are still values in lead field history.
Any thoughts!
i tried to call both methods at same time but not to delete and t tried to call the LeadGDPRDeleteFieldHistory as salesforce future call i am able to