I have an app that my users can create their own opportunity contacts. I need to present a list of possible contact roles. What can i call to get that list? The OpportunityContactRole requires I provide a oppId. I want the overall list of possible options.
I found this:
/ui-api/object-info/{objectApiName}/picklist-values/{recordTypeId}/{fieldApiName}
I assume:
{objectApiName} = OpportunityContactRole
what does {recordTypeId} and {fieldApiName} equal?
Best Answer
The
recordTypeId
property is the Record Type you want to describe; Record Types allow you to create different page layouts with different picklist options for the same picklist fields. ThefieldApiName
is the field you want to describe, such asRole
orMy_Custom_Field__c
.If you want all values, use the
recordTypeId
of012000000000000AAA
, this is known as the Master Record Type. If you don't want to get one specific field, you can get all fields on an object by omitting thefieldApiName
. So, for OpportunityContactRole records, you could can get all fields with:Or just one field with: