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
J&A-DevJ&A-Dev 

Need help structuring my data

Hi all,

 

I'm looking to see what is the best way to structure my data for later manipulation using triggers and classes. The trigger will fire after inserts and update updates. Here's what I'm trying to achieve:

- store a list of contact records with their new values (by calling Trigger.newMap)

- store a list of contact records with their old values (by calling Trigger.oldMap)

- compare the old and new values of certain fields and apply whatever logic I need to.

 

What's the best way to store these values in a trigger and pass them to a class? A constructor class, maps? What I'm looking to do is to be able to provide both the new and old values of a particular record by providing an Id.

 

Thanks in advance.