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
Shiva VenuShiva Venu 

How to get campaign Type value on Lead

We have a campaign type pickvalue field added on Lead which is the replica or Type in Campaign object. 
When a lead is created and associated to campaign, we need the Campaign Type field to add the Type value of associated campaign on lead. 
Also, when lead receive new campaign response, the campaign type should get updated according to the new campaign associated. 
PriyaPriya (Salesforce Developers) 

Hi Shiva,

You can achiece this by following below steps :-
1. creating a trigger on Lead object 
2. Query the campaing record to which you want to associcate this lead
3. Fetch the Campaign Type and assigng the Lead Type and update the lead record

Please let me know if this works for you.

Regards,

Priya Ranjan

Shiva VenuShiva Venu
Thanks for taking time to respond. Can someone help me with the code pls?

My Requirement:
- Field on Campaign : Type (Pick value - Conference, Tradeshow, Event)
- Field on Lead: Campaign Type(Pick Value - Conference, Tradeshow, Event)

When a lead is created and campaign is associated, Type value of campaign should get updated on Lead - Campaign type. Also, if a lead is updated with new/other campaign, the campagn type on lead should also get updated.