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

Trigger to set text field before lead converted

I need to set a custom text field before a lead is converted to a value.  This is needed so that I can map the custom field that is being set to a custom field on the opportunity.   Any ideas?

Venkat PolisettiVenkat Polisetti
Write a before insert trigger on Lead Obejct that would fire before creating Account, Contact or Opportuity. It would ensure your custom field mapping will copy the value to opportunity.

Make sure to turn on the Lead Setting "Enable Validation and Triggers from Lead Convert".