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
GrantMGrantM 

Setting Leads campaign lookup field through API

Hi
 
I have been asked if i can set the Lead's Campaign Lookup field through the API for lead assignment purposes.
Our sales team needs to route leads based on the campaign its attached to an would like to use the Leads Campaign lookup field.
 
Currently through the API I create a lead, and then create a campaign member to attach this lead to a Campaign.
 
I believe this bypasses our Assignment rules as these are called when the lead is created and at such time it does not belong to a Campaign.
Now when looking throught he API, i can use the Campaign lookup field to attach a lead to a Campaign as soon as the lead is created.
 
Is it possible to set the Lookup field through the API?
Or is this essentially doing the same thing i am throught he API?
 
TIA