Salesforce lwc - wire adaptor not able to have declared track variables as arguments

0 votes

0

I am trying to pull in picklist values of a field based on record type. The below works -

@wire(getPicklistValuesByRecordType, { objectApiName: 'Case', recordTypeId: '0123h000000kv04AAA' })
typePicklistValues({ error, data }) {
    if (data) {
        console.log(data.picklistFieldValues.Type.values)
        this.options = data.picklistFieldValues.Type.values;
    }
}

If I replace the ObjectAPIName & recordtype with a variable, it doesn't work -

@wire(getPicklistValuesByRecordType, { objectApiName: '$this.objectName', recordTypeId: '$this.recordTypeId' })
typePicklistValues({ error, data }) {
    if (data) {
        console.log(data.picklistFieldValues.Type.values)
        this.options = data.picklistFieldValues.Type.values;
    }
}

All those variables have the actual values, which I checked already, is there anything that I am doing wrong here?

Apr 8, 2022 in SalesForce by surbhi
• 3,810 points
692 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In SalesForce

0 votes
0 answers

Salesforce Apex SingleEmailMessage with Template to User not contact

Im trying to send an email in ...READ MORE

Feb 28, 2022 in SalesForce by surbhi
• 3,810 points
2,812 views
0 votes
0 answers

How to take test.salesforce.com while deployment as salesforce login url for api connection logic app?

In logic app i'm using salesforce connector after deployment ...READ MORE

Mar 1, 2022 in SalesForce by surbhi
• 3,810 points
824 views
0 votes
1 answer

How to take test.salesforce.com while deployment as salesforce login url for api connection logic app?

you are not passing the parameterValues, use ...READ MORE

answered Mar 2, 2022 in SalesForce by surbhi
• 3,810 points
762 views
0 votes
1 answer

How to take test.salesforce.com while deployment as salesforce login url for api connection logic app?

You are not passing the parameterValues, use ...READ MORE

answered Mar 9, 2022 in SalesForce by CoolCoder
• 4,400 points
580 views
0 votes
1 answer

Salesforce Apex SingleEmailMessage with Template to User not contact

// Pick a dummy Contact Contact c ...READ MORE

answered Mar 17, 2022 in SalesForce by CoolCoder
• 4,400 points

edited Jun 27, 2023 by Khan Sarfaraz 3,995 views
0 votes
1 answer

Cannot login to Salesforce Sandbox via python API

Set domain='test' and generate a new token ...READ MORE

answered Mar 1, 2022 in SalesForce by CoolCoder
• 4,400 points
1,429 views
+2 votes
2 answers

Salesforce Interview questions

Here are some questions very important for ...READ MORE

answered Jan 11, 2019 in Career Counselling by Suresh
• 720 points
2,772 views
0 votes
1 answer

How to connect to salesforce from tableau?

Hi, follow these steps to connect to Salesforce: 1. ...READ MORE

answered Mar 25, 2019 in Tableau by Cherukuri
• 33,030 points
746 views
0 votes
1 answer

Power BI - Salesforce

Hi, Follow below steps: 1. Go to Data source. 2. ...READ MORE

answered Mar 25, 2019 in Power BI by Cherukuri
• 33,030 points
486 views
0 votes
2 answers

What is the best training for Salesforce ADM-201 Exam?

Hi @Vardhan, I took Edureka's Salesforce Online Training, ...READ MORE

answered Jun 3, 2021 in Others by Jaya
• 140 points

edited Dec 22, 2021 by Soumya 545 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP