Sample Code:
Lightning Web Component:
HTML:
<template>
<lightning-record-edit-form record-id="0013i000003DPlvAAG"
object-api-name="Account"
onsuccess={handleSuccess}>
<lightning-messages></lightning-messages>
<lightning-output-field field-name="Name"></lightning-output-field>
<lightning-input-field field-name="Industry"></lightning-input-field>
<lightning-input-field field-name="Description"></lightning-input-field>
<lightning-input-field field-name="Rating"></lightning-input-field>
<lightning-button class="slds-m-top_small"
variant="brand"
type="submit"
name="update"
label="Update">
</lightning-button>
</lightning-record-edit-form>
</template>
JavaScript:
import { LightningElement } from 'lwc';
export default class AccountEditLWC extends LightningElement {
handleSuccess( event ) {
const payload = event.detail;
alert( JSON.stringify( payload ) );
}
}
Output:
Thanks, this is very helpful. The field I'm looking for isn't coming back in the payload, though (IsClosed on Case), although the field is on the input form in my lightning-record-edit-form. Thoughts on how I can add it?
Isclosed Indicates whether the case is closed (true) or open (false). This field is controlled by the Status field; it can't be set directly. So, use status field instead of IsClosed field.