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
Ron Mccrerey 20Ron Mccrerey 20 

Object OpportunityContactRole is not supported in UI API

Get the above error when trying to create an OpportunityContactRole record using LWC.

javascript Code

import retrieveOppContactRoles from '@salesforce/apex/getLastIncrementSTENum.getOppContactRoles';

let fields = {
ContactId: iterator.ContactId,
OpportunityId: oppId

createRecord({apiName: OPPORTUNITY_CONTACT_ROLE_OBJECT.objectApiName, fields })
.catch(error =>{ console.log( error); });

Error in Console
errorCode: "INVALID_TYPE"
message: "Object OpportunityContactRole is not supported in UI API"
statusCode: 400