Get Hands on with Conditional Directives and Refs || Salesforce Trailhead
ฝัง
- เผยแพร่เมื่อ 26 ส.ค. 2023
- #javascriptdeveloper1certificationmaintenancesummer23
#gethandsonwithconditionaldirectivesandrefs
#summer23releasesalesforce
Join this channel to get access to perks:
/ @salesforceagent
#salesforceagent
code :
parent.js
import { LightningElement, api, wire } from "lwc";
import { getRecord, getFieldValue } from "lightning/uiRecordApi";
import FIELD_NAME from "@salesforce/schema/Account.Name";
import FIELD_OWNER_NAME from "@salesforce/schema/Account.Owner.Name";
import FIELD_PHONE from "@salesforce/schema/Account.Phone";
import FIELD_INDUSTRY from "@salesforce/schema/Account.Industry";
export default class Parent extends LightningElement {
@api recordId;
@wire(getRecord, { recordId: "$recordId", fields: [FIELD_NAME, FIELD_INDUSTRY], optionalFields: [FIELD_PHONE, FIELD_OWNER_NAME] })
account;
get name() {
return getFieldValue(this.account.data, FIELD_NAME);
}
get phone() {
return getFieldValue(this.account.data, FIELD_PHONE);
}
get industry() {
return getFieldValue(this.account.data, FIELD_INDUSTRY);
}
get owner() {
return getFieldValue(this.account.data, FIELD_OWNER_NAME);
}
sayHi() {
let cmp = this.refs.child; //this.template.querySelector("c-child");
cmp.sayHi();
}
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>
parent.html
Account Name: {name}
Industry: {industry}
Phone: {phone}
Owner: {owner}
An error occurred while retrieving data
you are best bro
The video goes fizzy at 1:47mins
That’s a basic, anyone can create new playground for setting up new password and then connect username by login.
I'm getting this error while I have added Record Target in both XMLs.
We can’t find the Record Page target in the parent component’s metadata file. Please complete the prework.
Please help me
are you able to fix this?
Hi @mohdsarfraz. i am also facing same error message We can’t find the Record Page target in the parent component’s metadata file. Please complete the prework. do you have any solution for that , Please help me.
thank you
I’ll suggest you guys to create new playground and start with same steps will solve your problem for sure .
@@salesforceagent I have created new playground still I am getting the same issue
can you pleas help me
@@manikumar1662 share me screenshots on Instagram, i'll check . Thanks.
i dont have parent under "custom" for the burlington account
Did you created new playground before starting this module ??
Yes, I did. But yet it is not showing@@salesforceagent
I know you blurred some of your content to protect your private information. I'm lost after creating an org.
What’s the issue you facing ?
@@salesforceagentnot sure how to get to @3:28
whats the point of this video everything is blurred
That’s a basic, anyone can create new playground for setting up new password and then connect username by login.