This error has recently appeared for me again on an LWC, but only the very first time I open a page for this record type after logging into the org - thereafter never again for my session. And I can't replicate this in my Dev sandbox at all - only in my production org and QA (which is a full sandbox). The only time I get it again is if I log out of the org and back in again. It is extremely frustrating as I don't understand what the problem is.
I would appreciate any help in sorting this out.
My HTML:
<div class="slds-card__body slds-card__body_inner">
<div class="slds-var-m-around_medium slds-text-heading_small">
<template if:true={reasonPicklistValues.data}>
<lightning-combobox
name="reason"
label="Select a reason"
value={value}
placeholder="-Select-"
options={reasonPicklistValues.data.values}
onchange={handleChange}
class="slds-var-m-around_x-small">
</lightning-combobox>
</template>
</div>
</div>
And my JS:
@api recordId;
@api objectApiName;
@track objectInfo;
@wire(getObjectInfo, { objectApiName: CERTIFICATE_OBJECT })
objectInfo;
get recordTypeId() {
if (this.objectInfo.data) {
if (this.objectInfo.data.recordTypeInfos) {
const rtis = this.objectInfo.data.recordTypeInfos;
return Object.keys(rtis).find(
(rti) => rtis[rti].name === "XYZ Certificate"
);
}
}
return null;
}
@wire(getPicklistValues, {
recordTypeId: "$recordTypeId",
fieldApiName: GENERATEMANUALREASON_FIELD
})
reasonPicklistValues;
if(what)
i would doif(what != null)
objectInfo
variables? I'm guessing this is going to create confusion. The wire function will store the results in the objectInfo declared below it. You don't need the@track objectInfo
variable.