I have an lwc action button that loads the popup. When i load the component for first time, recordId is present. But when i close and open it again(without reloading the whole page), recordId is lost. Kindly advise
export default class EmeaSubmitEvalRequest extends LightningElement {
_recordId;
@api recordId;set recordId(value) {
this._recordId = value;
console.log('in setter',this._recordId);
}
get recordId() {
return this._recordId;
}
constructor(){
super();
console.log('constrcu',this.recordId);//not printed at all
}
connectedCallback(){
console.log('connected recid',this.recordId);//not printed at all
}
@wire(invokeMuleService)
getDropdownOptions({error,data}){
if(data){
this.defaultValues();
}
}
@api async defaultValues(){
console.log('recid',this.recordId); **//NEED RECORD ID HERE ANYHOW**
await fetchExistingValues@wire(fetchExistingValues,{evalId'evalId':this.recordId'$recordId'}).then((result)=>{
ifpreLoadValues(result{error,data}){
...//do some logic
}
})here
}