0

I'm working with an organization that would like to generate comprehensive logs of every change to every record in all standard and custom object. This would be like Field Audit Trail, but going beyond the 60 field limit. We don't need to keep the log data in Salesforce very long because we would periodically (hourly, daily) offload it to a data warehouse.

I'm wondering if this can be accomplished with an Apex Trigger on each object which captures and stores the old and new values for each field in a standard log table. Essentially we are re-creating Field History Tracking, but getting beyond the field limits.

Is implementing this approach possible in a production Salesforce org? I'm concerned that we would run into limitations on CPU, memory, or DML transactions. Does anyone have experience trying to do something like this and is it feasible?

2
  • 4
    I would first talk to your account executive, as I believe this limit can be raised. As for feasibility, it would likely depend on how many fields you have, and how often you change them, but it would likely be within platform limits. Then again, if you have bulk operations including long text area fields of max length, you could have some trouble.
    – Adrian Larson
    Jan 13 at 3:29
  • 3
    Not every sObject supports triggers. This requirement seems excessive and inordinately expensive to me, to the point of inquiring if Salesforce is an appropriate solution for this org.
    – David Reed
    Jan 13 at 4:48

1 Answer 1

1

Realistically, it'd be far easier to simply implement Change Data Capture from the data warehouse directly, though this means that you're going to have to get the "CDC addon", since the default allocation is only five objects. Alternatively, the Data Replication API can allow you to detect that records are changed, but those specific changes would need to be detected by the integration, and the API itself is meant to be used with five minute windows, which may not suit your needs. As also mentioned, not all objects support triggers, though most objects support either CDC or the Data Replication APIs. Depending on what you mean by capturing all data changes, at least one of these two APIs should get you most of the way there.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .