For a few reasons**, I'd like to build the following. Upon updating CustomObj1 (usually via Edit->Save),
- Take a 'snapshot' of that object, recording all field values.
- Find out which field values changed in CustomObj1 before Update
- Insert a record into another c-object, CustomObj2, which is a near exact-replica of the original custom object, CustomObj1
- Add those values as content in a large Text box in CustomObj2, perhaps broken by line breaks and/or Bullet points (for summary details about the record Update)
- Insert CustomObj2, with a foreign-key reference to CustomObj1 (one-to-many relationship, CustomObj1 to CustomObj2)
And a few questions/Concerns:
- What is the best way to identify changed field values? Perhaps with a
for each
? - Is this going to be a nightmare in terms of data size? CustomObj1 currently has about 30 custom fields, and less than 5,000 records. These are updated somewhat frequently, though, at about 1-3 times per month, each.
** My reasons, in case you think I'm crazy:
- Activity History for objects only supports about 20 fields, I have more than that at this point
- Full object snapshots could be really valuable down the road
- Looking to get more trigger experience regarding data manipulation