Posts

Showing posts with the label TRIGGER

🛠️ Custom Field Change Tracking in Salesforce – Overcoming Limitations of Field History Tracking

Salesforce is powerful, but like every platform, it has limitations. One such limitation is related to Field History Tracking —you can only track up to 20 fields per object , and even then, certain field types (like long text areas) aren’t supported. I recently came across this limitation during a project where tracking every update to Task fields was critical for compliance and reporting. So, I designed a custom field tracking solution using Apex Triggers and a custom object. In this post, I’ll walk you through how I built it and how you can implement it too. ❗ Why Custom Tracking? Out-of-the-box Salesforce lets you: Track up to 20 fields per object. Track changes on limited data types (excludes Long Text Area, Rich Text, etc.) View changes only in the standard history related list. But in my case, I needed to: Track more than 20 fields. Track long text fields like Description . Store change history in a separate custom object. Restrict deletion of histor...

What is Apex Triggers.? Why we Use? What is Syntex? What is Events? What is Context Variable? What is bulkify triggers?

➡️ Apex Triggers:- -> This is automation tool.  Apex triggers enable you to perform custom actions before or after changes to Salesforce records, such as insertions, updates, or deletions. -> It  executes before or after the following types of operations : Insert Update Delete Upsert Undelete Merge 📌Important:- - > Don't Query and DML Operation in the Loop. -> Apex trigger can be created for both standard & custome objects. -> By default trigger are active as you create them. -> We can make sure our trigger is always bulkify . ➡️ Why we use Apex Triggers? -> When we are not abel to solve some complex requirements throuth Salesforce Point and Click tools (Flows, PB, WF) then we can use apex triggers. ➡️ Types of Apex Triggers:- =>  There are two types of triggers. ->  Before triggers are used to update or validate record values before they’re saved to the database . ->  After triggers are used to access field values that...