Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

241
Views
Can we create a record for Event object through lwc in Salesforce?

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.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can check list of supported obejcts for createRecord in this All Supported Objects documentation.

As you can mention, Event object is not listed here.

You'll need to create custom static Apex method and call in imperatively from your js of lwc component, in order to create Event from lwc.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!