How to use the lightning/uiRecordApi.generateRecordInputForUpdate function in lightning

To help you get started, we’ve selected a few lightning examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github salesforce / base-components-recipes / force-app / main / default / lwc / recordEditUtils / recordEditUtils.js View on Github external
export async function ldsUpdateRecord(newRecord, originalRecord, objectInfo) {
    newRecord.id = originalRecord.id;
    newRecord.apiName = null;
    const newRecordEdit = generateRecordInputForUpdate(
        normalizeRecord(newRecord),
        objectInfo
    );

    const recordToSave = createRecordInputFilteredByEditedFields(
        newRecordEdit,
        originalRecord
    );

    return updateRecord(recordToSave);
}