Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

243
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda