1

I have implemented a promise using the ui/RecordApi to update a record in Salesforce. Strangely that promise never resolves or rejects or even enters finally. Below is a sample code for this. Please note that the record does get updated.

Have you faced this issue? Any help of suggestion is helpful.

import { updateRecord } from 'lightning/uiRecordApi';

export default class Lb2bCheckoutFinalCartV2 extends NavigationMixin(LightningElement) {
    someMethod() {
        //setting the recordInput
        updateRecord(recordInput);
        .then(() => {
              //Never enters
        })
        .catch((error) => {
             //Never enters
        });
        .finally(() => {
             //Never enters
        })
    }
}
user1800524
  • 65
  • 1
  • 5

1 Answers1

0

You have a semicolon after "update record". Your "then" isn't connected to anything. And again semicolon after "catch"

eyescream
  • 18,088
  • 2
  • 34
  • 46
  • Hello, thank for your reply. but please ignore the semicolon, that was typepo – user1800524 May 17 '23 at 17:31
  • 1
    do you have setup -> debug mode enabled so the lightning compiles for debug rather than release? are you able to put in breakpoints, `debugger;` statements in the sections? if the object being updated has any automation (triggers, flows, process builder, validation rules) -> can you run with dev console open / debug logs and verify automation is called, save succeeds, it's "just" that promises don't resolve client-side? Does https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.reference_update_record work in your org? – eyescream May 17 '23 at 20:10