LWC 項目API名利用する方法


import AAAAA from ‘@salesforce/schema/object__c.columnapi__c’;

参照: AAAAA.fieldApiName

ついでに
① 項目の値の値を取得

getLightningInputFieldValue(fieldNameStr){
        const inputFields = this.template.querySelectorAll('lightning-input-field');
        let retValue;
        if (inputFields) {
            inputFields.forEach(field => {
                if(field.fieldName == fieldNameStr) {
                    retValue = field.value;
                }
            });
        }

        return retValue;
}


②標準項目のリセット

    resetLightningInputField(fieldNameStr){
        const inputFields = this.template.querySelectorAll('lightning-input-field');
        if (inputFields) {
            inputFields.forEach(field => {
                if(field.fieldName == fieldNameStr) {
                    field.reset();
                }
            });
        }
    }

    //項目リセット
    resetAllField() {
        const inputFields = this.template.querySelectorAll('lightning-input-field');
        if (inputFields) {
            inputFields.forEach(field => {
                field.reset();
            });
        }
    }