답변 2개
Hi Kishore,You don't have to make things complicated here, It's simple as this1. After triggers execute after the data has been inserted, updated or deleted in the database. So in case of 'after delete', if you query the data you may not find the data on which trigger has performed action. 2. Before triggers execute before the data has been committed into the database. This means that if you decided to query the data it either would exist (in case of before delete) if it was an insert or if it’s being updated it would still be the previous values or no .3. The after undelete trigger event only works with recovered records—that is, records that were deleted and then recovered from the Recycle Bin through the undelete DML statement. The after undelete trigger events only run on top-level objects. To see please refer: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_recovered_records.htmI hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.Thanks,Ajay DubediHi Kishore,You don't have to make things complicated here, It's simple as this1. After triggers execute after the data has been inserted, updated or deleted in the database. So in case of 'after delete', if you query the data you may not find the data on which trigger has performed action. 2. Before triggers execute before the data has been committed into the database. This means that if you decided to query the data it either would exist (in case of before delete) if it was an insert or if it’s being updated it would still be the previous values or no .3. The after undelete trigger event only works with recovered records—that is, records that were deleted and then recovered from the Recycle Bin through the undelete DML statement. The after undelete trigger events only run on top-level objects. To see please refer: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_recovered_records.htmI hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.Thanks,Ajay Dubedi