Activity Forums Salesforce® Discussions In salesforce how can we find out the deleted record in After delete trigger?

  • In salesforce how can we find out the deleted record in After delete trigger?

  • sushant

    Member
    December 29, 2016 at 3:17 pm

    Hi All,
    How can we find out the deleted record in After delete trigger?

    please give suggestions

    Thanks

  • PRANAV

    Member
    January 6, 2017 at 2:52 pm

    Hi Sushant,
    To get or Query deleted records you need to use ALL ROWS So your query will be

    List<Object__c> lisOfDeletedRecords = [SELECT Id FROM Object__c WHERE ID IN :lstTriggerOld AND ID NOT IN : lstAllRecords ALL ROWS];

    Hope this helps you.

    Thanks

  • shariq

    Member
    July 17, 2017 at 1:58 pm

    Hi Sushant,

    You can use Trigger.old method in trigger, for example :- [SELECT Id FROM Sobject__c WHERE Id IN : Trigger.old AND Id NOT IN : (List which includes all Sobject__c's Id)];

Viewing 1 - 3 of 3 posts

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos