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
pi r2pi r2 

Apex trigger to copy from Lead Standard Picklist field to Lead Custom Picklist field

Does anyone have some Apex trigger code that they would be willing to share that would let me copy the value from a Lead Standard Picklist field to a Lead Custom Picklist field on Save?

 

I'm trying to copy the value from Lead: Status into a Custom Lead Picklist field where the two fields have the same picklist values.  A workflow + field update won't work.

asish1989asish1989

Hi

   Try this

        

trigger CopyingStatusToCustopicklist on Lead(before insert) {
         for(Lead lead :Trigger.new){
                  lead.CustomPicklist__c = lead.Status;
         }
}

 

Did this post solve your problem If so please mark it solved otherwise let me know about your Issue.

 

Thanks

asish