I have a parent and child component. In child component, using wire service to fetch picklist values of a custom object. However data and error comes as undefined always. When checked the log, the sequence is like below:
- Parent connected callback
- @wire service invoked but data undefined
- Child connected callback
- so on...
Code is as below: Parent LWC:
<template>
<template if:true={renderChild}>
<c-child-comp></c-child-comp>
</template>
</template>
Child LWC:
<template if:true={industryPicklist.data}>
<lightning-combobox name="indType" label="Industry Type" value={indTypeValue}
options={industryPicklist.data.values} onchange={handleindTypeChange}>
</lightning-combobox>
</template>
Child js:
import ACCCUSTOM_OBJECT from '@salesforce/schema/Account_custom__c';
import IND_TYPE_FIELD from '@salesforce/schema/Account_custom__c.IndustryType__c';
....
@wire(getObjectInfo, { objectApiName: ACCCUSTOM_OBJECT })
accCustomMetadata;
@wire(getPicklistValues, { recordTypeId: '$accCustomMetadata.data.defaultRecordTypeId',
fieldApiName: IND_TYPE_FIELD })
industryPicklist;
The above code works as an independent lwc, however when used with Parent, its not working. Can someone pls point out the issue?