function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sree SalesforceSree Salesforce 

difference between trigger context and class context

Rajesh PotnuruRajesh Potnuru
Stop spamming with your interview questions
Ankit AroraAnkit Arora
Trigger is executed based on event which you've defined in Trigger like before update/insert after update/insert etc. Class can be called from multiple places like you can execute a class via VFP (visualforce page), class can also be executed using a trigger. Trigger and class have different implementations so when event is called and trigger is executed context is of trigger and when any VFP is calling any class it's called class context.