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

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
body:
errorCode: "INVALID_TYPE"
message: "Object OpportunityContactRole is not supported in UI API"
statusCode: 400
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
body:
errorCode: "INVALID_TYPE"
message: "Object OpportunityContactRole is not supported in UI API"
statusCode: 400