I have a
before insert trigger on leads that translates a few fields that are populated from a web form that is translated into multiple languages. This is working well.
If there is no matching translation found, I want to flag the record as having an error so it can be resolved. I would like to log an activity for this, to avoid cluttering up the object with fields for specific integrations. However, it seems like this is not possible because I cannot access the Id in a before insert trigger, so I cannot related the activity to the lead.
Is the only option to use a field on the lead to flag issues? Is there some trick to this that I am missing?
This must be a before insert trigger because some of the fields are restricted picklists, and the translations must process before the insert. The trigger sets the picklist to null if there is no matching translation to allow the lead to be inserted.