Is it possible when adding a lead via Apex code, to set the campaign that the lead belongs to?
I have a published app which retrieves lead data from an external API. The app can create a lead with standard fields set (first name, last name, etc).
In my app config settings I have added a field for the campaign name. The user will set this to the campaign which future created leads should be assigned to.
On this page https://help.salesforce.com/articleView?id=leads_fields.htm&type=5 it shows that the lead object has a campaign field, but in the developer console if I try and execute this query
SELECT Campaign FROM Lead
I am told that the no such column exists for Campaign. How can I assign a lead to a campaign?
Also, Is there a way (API or within SF) to see the fields in each object?