You need to sign in to do that
Don't have an account?
Sarita Pa 3
Lightning web component Wiring.
Hi Team,
Can it be possible to call wired method in another wired method.
Sporadically the name value is being sent to Apex class empty, i am thinking this might be because of the order of invoking the wired is not coming before the getrecord. Is there any way to call one wired function in another wired method.
Attaching the sample code.
Thanks for your help with this.
Thanks and Regards,
Venkata.
import {getRecord} from 'lightning/uiRecordAPi'; import dataBasedonName from 'apex/class/test.getName; @track name; @api recordId; @wire (getRecord,{recordId:$recordId,fields:['Name']} wiredInfo({data}){ if (data) { this.name=data.fields.name; } } @wire (dataBasedonName,{name:$name}) wiredNameList({data}){ if(data){ } }
Use below code. Now the first wire funnction will get the values of RecordInfo, then the second one will be excuted.
hope this will wwork for you.
Thanks
karthik
Thank you for the reply I am getting the same issue again.