How to use the lightning/uiRecordApi.getFieldValue 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 barryhughes1 / pluralSightQuestionnaires_LWCs / 04. Completed Solution / main / questionnaires / lwc / questionnaireCard / questionnaireCard.js View on Github external
questionnaireRecord(result) {
        if (result.data) {
            this.questionnaireRec = result.data;
            this.name = getFieldValue(this.questionnaireRec, QUESTIONNAIRE_NAME_FIELD);
            // this.name = this.questionnaireRec.fields.Name.value;
            this.description = getFieldValue(this.questionnaireRec, QUESTIONNAIRE_DESCRIPTION_FIELD);
            // this.description = this.questionnaireRec.fields.Description__c.value;
            this.status = this.questionnaire.questionnaireStatus;
            this.setCardTheme();
            this.setQuestionsAskedAndAnswered();
            this.error = undefined;
        } else if (result.error) {
            this.error = result.error;
            this.questionnaireRec = undefined;
        }
    }
github barryhughes1 / pluralSightQuestionnaires_LWCs / 04. Completed Solution / main / questionnaires / lwc / questionnaireCard / questionnaireCard.js View on Github external
questionnaireRecord(result) {
        if (result.data) {
            this.questionnaireRec = result.data;
            this.name = getFieldValue(this.questionnaireRec, QUESTIONNAIRE_NAME_FIELD);
            // this.name = this.questionnaireRec.fields.Name.value;
            this.description = getFieldValue(this.questionnaireRec, QUESTIONNAIRE_DESCRIPTION_FIELD);
            // this.description = this.questionnaireRec.fields.Description__c.value;
            this.status = this.questionnaire.questionnaireStatus;
            this.setCardTheme();
            this.setQuestionsAskedAndAnswered();
            this.error = undefined;
        } else if (result.error) {
            this.error = result.error;
            this.questionnaireRec = undefined;
        }
    }
github dreamhouseapp / dreamhouse-lwc / force-app / main / default / lwc / daysOnMarket / daysOnMarket.js View on Github external
wiredRecord({ error, data }) {
        if (data) {
            this.error = undefined;
            this.dateListed = getFieldValue(data, DATE_LISTED_FIELD);
            this.daysOnMarket = getFieldValue(data, DAYS_ON_MARKET_FIELD);
            if (this.daysOnMarket < MAX_DAYS_NORMAL_STATUS) {
                this.status = 'normal';
            } else if (this.daysOnMarket < MAX_DAYS_WARNING_STATUS) {
                this.status = 'warning';
            } else {
                this.status = 'alert';
            }
        } else if (error) {
            this.daysOnMarket = undefined;
            this.dateListed = undefined;
            this.status = undefined;
            this.error = error;
        }
    }
github dreamhouseapp / dreamhouse-lwc / force-app / main / default / lwc / propertyCarousel / propertyCarousel.js View on Github external
get description() {
        return getFieldValue(this.property.data, DESCRIPTION_FIELD);
    }
github dreamhouseapp / dreamhouse-lwc / force-app / main / default / lwc / brokerCard / brokerCard.js View on Github external
get brokerId() {
        return getFieldValue(this.property.data, BROKER_FIELD);
    }
github dreamhouseapp / dreamhouse-lwc / force-app / main / default / lwc / daysOnMarket / daysOnMarket.js View on Github external
wiredRecord({ error, data }) {
        if (data) {
            this.error = undefined;
            this.dateListed = getFieldValue(data, DATE_LISTED_FIELD);
            this.daysOnMarket = getFieldValue(data, DAYS_ON_MARKET_FIELD);
            if (this.daysOnMarket < MAX_DAYS_NORMAL_STATUS) {
                this.status = 'normal';
            } else if (this.daysOnMarket < MAX_DAYS_WARNING_STATUS) {
                this.status = 'warning';
            } else {
                this.status = 'alert';
            }
        } else if (error) {
            this.daysOnMarket = undefined;
            this.dateListed = undefined;
            this.status = undefined;
            this.error = error;
        }
    }