Hi all,
I asked this in Questions (https://success.salesforce.com/answers?id=9063A000000eNMvQAM) but didn't get any responses. Probably not the right place, so I will try here.
I'm building a new Lightning Web Component that creates a record for a case. I have everything working as desired except the ability to set the record type on the case.
I'm trying to explicitly set it using a variable based off this import:
import RECORDTYPE_FIELD from '@salesforce/schema/Case.RecordTypeId';
Here is how I am setting it:
fields[RECORDTYPE_FIELD.fieldApiName] = "xxxxxxxxxxxxxxx";
Here is how I am calling the API:
const recordInput = { apiName: CASE_OBJECT.objectApiName, fields };
I'm passing it the Record Type ID value (I've tried the 15 and 18 character versions).
Every other field I'm setting works except record type. Any suggestions?
I'm using this article as my guide post: https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.data_salesforce_write