You need to sign in to do that
Don't have an account?
Will Jones 18
Unable to pull OpportunityContactRole deleted records
I am attempting to do a call out to an external server to notify it to remove a contact from an opportunity if it is removed from the contact role on the opportunity in Salesforce. However the query I am attempting to use does not return any records. I attempted to delete a contact from an Opportunity and when I check by debug log I see that my query does not ever return any record. I trigger the opportunity successfully when the opportunitycontactrole is edited/deleted but it doesn't return the record. Any suggestion?
trigger OCR on Opportunity (after insert, after update, after delete) { List<OpportunityContactRole> ocr_list_del = [SELECT Id, OpportunityId, ContactId, Role, IsPrimary FROM OpportunityContactRole WHERE OpportunityId IN: Trigger.newmap.keyset() AND IsDeleted=true ALL ROWS]; SYSTEM.DEBUG('The OCR Delete List Size is ' + ocr_list_del.size()); }
Is this a recent change?