Let’s say we have to update the same record in after trigger context. Is there any way or workaround?



Let’s say we have to update the same record in after trigger context. Is there any way or work..

Answer / Sunita Tevatiya

To update the same record multiple times within an After Trigger, you can use a static variable to store the ID and compare it before updating the same record. However, be aware that this might lead to issues if your trigger is invoked in a loop. It's better to consider using Apex Queue (Batch Classes) or Future methods for processing multiple records.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Salesforce Interview Questions

What are the types of sharing rules in salesforce and explain it?

1 Answers  


How many records can we fetch using one soql query?

1 Answers  


Explain Data Migration in Salesforce?

1 Answers   TCS,


Explain Approval Terminology?

1 Answers  


What can cause data loss in salesforce?

1 Answers  


What are validation rules? : salesforce validation rules

1 Answers  


Is it possible to change the existing data types of custom fields, if Yes please explanin?

1 Answers  


What is the apex in salesforce?

1 Answers  


Why we use @future annotation?

1 Answers  


How do you create a lightning app in salesforce?

1 Answers  


What is the appexchange?

1 Answers  


When can you use sandbox org?

1 Answers  


Categories