I tried submitting a ContactId
with the Opportunity, but received
ERROR: INVALID_FIELD: No such column 'ContactId' on sobject of type Opportunity
Is there any documentation?
If you look at the schema, there is no OOTB field ContactId on Opportunity
Instead, you use the junction object: OpportunityContactRole which has two lookup keys
Of course, you can always add a custom field on Opportunity such as ContactId__c
and you should check with your org's schema to see if this was already done
In general, you want to use the OpportunityContactRole as more than one contact can be associated with an Opportunity and many managed packages rely on this relationship to do useful things (e.g. Hubspot tracks Deals this way)
OpportunityContactRole
via REST API was straightforward. Do I need to use IsPrimary
or Role
fields?
IsPrimary
is defaulted on Create and Role
is optional. If you do use roles, they have to be ones defined already in metadata: Setup | Customize | Opportunities | Contact Roles on Opportunities