You need to sign in to do that
Don't have an account?

getting value of Id from @wire method
Hi, Please check, there is a wireMethod which returned the value from apex
@wire(fetchRecord, {searchKey:'$searchKey', selectedLabel:'$selectedLabel'})recorddetails;
There is an Id value in recorddetails. I need to pass this value of Id in another variable for another invocation.
Could you please mention, how can i retrieve the value of recorddetails.Id
I shall be grateful to you for your kind cooperation.
Thanks and regards
@wire(fetchRecord, {searchKey:'$searchKey', selectedLabel:'$selectedLabel'})recorddetails;
There is an Id value in recorddetails. I need to pass this value of Id in another variable for another invocation.
Could you please mention, how can i retrieve the value of recorddetails.Id
I shall be grateful to you for your kind cooperation.
Thanks and regards
@wire(fetchRecord, {searchKey:'$searchKey', selectedLabel:'$selectedLabel'})recorddetails;
const searchKey = event.target.value;//this.template.querySelector('lightning-input').value;
this.searchKey = searchKey;
this.parentId1 = JSON.stringify(this.recorddetails.data);
this.parentId1 = JSON.parse(this.parentId1.trim())//this.parentId1.trim();
this.parentId = this.parentId1[0].Id;
console.log('this.parentId---->', this.parentId);
All Answers
Please paste the apex code for the method as well.
Thanks Pinky for your kind response. Please check all the code
const searchKey = event.target.value;//this.template.querySelector('lightning-input').value;
this.searchKey = searchKey;
this.parentId1 = JSON.stringify(this.recorddetails.data);
this.parentId1 = JSON.parse(this.parentId1.trim())//this.parentId1.trim();
this.parentId = this.parentId1[0].Id;
console.log('this.parentId---->', this.parentId);