+ Start a Discussion

Adding leads with Flex Toolkit

I've successfully created a form in Flex to insert leads to my sf account. But I'm having trouble figuring out how to assign a campaign to the new lead added.

Ron HessRon Hess
So that the lead has a record in the Campaign History related list?
you would create a CampaignMember record containing the lead id, and the campaign id, and a status.
I see... so I would take the lead id returned from the new lead and add it to a new CampaignMember record immediately following the lead insert.

Am I following correctly?
Yup that's it.  Leads and Contacts become campaign members when they are referenced by id from the CampaignMember record that also references a particular campaign by id.

I've posted a question that I believe that you may be able to answer.  I am also trying to insert a lead into SalesForce from Flex.  I think everything is fine with the exception of the Lead.ID.  How is this set?