• Brent Woodard 10
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
I have a custom field on my Lead object, it's a pick list named LeadSource.

On my custom object "Checkout" whenever someone uses a lookup relationship to select the lead, I want it to automatically fill out a custom field on that called marketing source. I need it to do something like the code written below. I'm a C# developer by history and I'm not even sure if I need to create a new object here or if everything is already loaded.

Here is the code I wrote, I wouldn't think it would be much more complicated than this but I need help.
 
trigger <SetMaketingSource> on Checkout__c (before insert, after insert, after update) {
Lead.LeadSource = Checkout__c.Marketing_Source__c
}

 
I have a custom field on my Lead object, it's a pick list named LeadSource.

On my custom object "Checkout" whenever someone uses a lookup relationship to select the lead, I want it to automatically fill out a custom field on that called marketing source. I need it to do something like the code written below. I'm a C# developer by history and I'm not even sure if I need to create a new object here or if everything is already loaded.

Here is the code I wrote, I wouldn't think it would be much more complicated than this but I need help.
 
trigger <SetMaketingSource> on Checkout__c (before insert, after insert, after update) {
Lead.LeadSource = Checkout__c.Marketing_Source__c
}