So I am calling apex via wire decorator, and I am passing in 3 inputs. The accountId
and contactId
are dependent on other wire service getRecord
, when I receive the data from getRecord
and populate one of the two variables the second wire service won't trigger.
@wire(getRecord, {recordId: '$userId', fields: [AccountId, ContactId, SUSE_Administrative_Privileges]})
wireUser({error, data}) {
if (data) {
if (getFieldValue(data, SUSE_Administrative_Privileges).includes('Opportunity Administrator')) {
this.accountId = getFieldValue(data, AccountId);
console.log('accountId', this.accountId);
} else {
this.contactId = getFieldValue(data, ContactId);
console.log('contactId', this.contactId);
}
} else if (error) {
console.error(error);
}
}
sobjects;
@wire(getSObjects, {accountId: '$accountId', contactId: '$contactId', dashboardFilter: '$dashboardFilterValue'})
wireSObjects({error, data}) { //wont trigger second time?? why...}