getSettings method below returns settings JSON record and when i am trying to set picklist options using productFamilyOptions variable which is used as options of the .html file, I am getting this error("ReferenceError: a is not defined at eval (eval at productFamilyOptions) in the catch section below. Can someone please help.
<template>
<lightning-combobox name="ProductFamily" label="Product Family" value={Opp.Type__c} placeholder="select product family" options={productFamilyOptions}></lightning-combobox>
</template>
JavaScript
import { LightningElement, track, wire} from 'lwc';
import getSettings from '@salesforce/apex/ContactsUtility.getSettings';
export default class CreateOpportunity extends LightningElement {
@track productFamilyOptions = [];
connectedCallback() {
getSettings() .then(result => {
for(let key in JSON.parse(result[0].Data__c).family){
if(key){
this.productFamilyOptions.push({"label":key,"value":key});
}
}
})
.catch(error => {
this.error = error;
});
}
{}
tool in the editor, or select + Ctrl-K, to format your code so that the community can read it.