You need to sign in to do that
Don't have an account?

How to create an Opportunity Partner via the API?
Hi there,
how is one supposed to create an "OpportunityPartner" object using the API? According to the Apex Explorer this object is only query-able and retrieve-able, so basically a readonly construction.
So, is creating/updating a new OpportunityPlan plain impossible is there just a trick that I'm unaware of?
Cheers,
Harry
The way to create an OpportunityPartner is actually through creating another type of object. You need to create a "Partner" object and fill in the OpportunityId, AccountToId, and IsPrimary fields. The Role field is not required, but you may wish to fill that in as well. Leave the AccountFromId and ReversePartnerId fields empty (null).
AccountPartner records are created in a similar fashion, where you leave the OpportunityId null and instead fill in the AccountFromId. Salesforce determines which type of record to create (OpportunityPartner or AccountPartner) based on which fields are filled in. It will give you an error if you attempt to fill in both the OpportunityId and the AccountFromId fields.
Why they chose to do it this way isn't clear. There are a few other places in the schema that may act similarly, so if you find yourself unable to create a particular type of object, you can often accomplish what you want by creating another type of object (e.g. you can create a completed Task, but you can't directly create an ActivityHistory record).
All Answers
The way to create an OpportunityPartner is actually through creating another type of object. You need to create a "Partner" object and fill in the OpportunityId, AccountToId, and IsPrimary fields. The Role field is not required, but you may wish to fill that in as well. Leave the AccountFromId and ReversePartnerId fields empty (null).
AccountPartner records are created in a similar fashion, where you leave the OpportunityId null and instead fill in the AccountFromId. Salesforce determines which type of record to create (OpportunityPartner or AccountPartner) based on which fields are filled in. It will give you an error if you attempt to fill in both the OpportunityId and the AccountFromId fields.
Why they chose to do it this way isn't clear. There are a few other places in the schema that may act similarly, so if you find yourself unable to create a particular type of object, you can often accomplish what you want by creating another type of object (e.g. you can create a completed Task, but you can't directly create an ActivityHistory record).
So far, this works:
However, I can't figure out the formula for the value that will reference a field on the Account object ("{!PartnerID}") and fill this Role with the field value on the referencable field:
The field on the partner account object is SFCCLtngPtr__Partner_Type__c
Any ideas? I've tried "{!OpportunityID.PartnerID.SFCCLtngPtr__Partner_Type__c}" as the formula, but when I save my flow an error appears: