This is my js code:
var fields = {'OwnerId': user,'CreatedById': user,'WhoId': this.doctorName ,'StartDateTime':this.startDate, 'EndDateTime':this.endDate, 'Departments__c': this.depName, 'Doctor_Name__c': this.doctorName};
var objRecordInput = {'apiName' : 'Event', fields};
// LDS method to create record.
createRecord(objRecordInput).then(response => {
alert('Event created with Id: ' +response.id);
}).catch(error => {
alert('Error: ' +JSON.stringify(error));
});
I am getting this error:
Error: {"status":400,"body":{"message":"Object Event is not supported in UI API","statusCode":400,"errorCode":"INVALID_TYPE"},"headers":{}}
I have tried using lightning-record-form earlier. I got this same error. That's why I created my own UI, but that is also not working.