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
DustyDusty 

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.

Thanks,
Dusty
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.
DustyDusty
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?
AcronymAcronym
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.

whitfty1whitfty1
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?