You need to sign in to do that
Don't have an account?
VASCOdev
Link lead to a campaign on Lead creation via API web service
At the moment, the only way I found out in order to create a lead and link it to a campaign in SalesForce via the API web service, is to first create the lead, and then create a campaignMember object which I link to the created lead (campaign id + lead id).
Question: is there a way to push the lead with the linked campaign all at the same time?
Simple answer ... No (at least i don't think so).
As i understand it you need to create a Lead object and insert that, then create a campaign member object and insert that.
Whilst they are related there appears to be no direct "relationship field" defined on the Lead object else you could do it by inserting the lead with the relationship value defined.
Having said that, try it most relationships are called something like "OtherObject__r" which means in your case if it can be done it's likely to be defined as "Campaign_Member__r" on the lead object.
If you get an error when defining that field, chances are you're back to making 2 calls.
Anyone else out there know any better?????
Feel free to correct me!!!
Thanks!