You need to sign in to do that
Don't have an account?
Romeo Ngo 1
Campaign field in Lead
When we use Web to Lead, we can provide a CampaignID to associate the Lead with specific Campaign.
I just recently found out that we can't use Lead.Campaign field since it is not available through the API.
Now how can one capture this fields on insert Trigger? IE, if a lead is added VIA web-to-lead and we want to get the campaign associate with it but we capture this on the insert. We can't query the database for it because the lead and the campaign member is not added yet.
I just recently found out that we can't use Lead.Campaign field since it is not available through the API.
Now how can one capture this fields on insert Trigger? IE, if a lead is added VIA web-to-lead and we want to get the campaign associate with it but we capture this on the insert. We can't query the database for it because the lead and the campaign member is not added yet.
Lead and Campaign are not directly related to each other. There is a middle object CampaignMember in between them. Here is an example how to relate Lead with Campaign.
Please let me know if this helps you.
Best Regards,
-Vivek
I'm well awared of that.
The problem is with Web-To-Lead which has a campaign field but we want to get the CampaignID with an before insert trigger.
IE Above.
if a lead is added VIA web-to-lead and we want to get the campaign associate with it but we capture this on the insert. We can't query the database for it because the lead and the campaign member is not added yet.