Questions tagged [parent-to-child]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
55 views

querySelector for extended component does not work

I have a class which extends a Datatable. From there I want to call the child component, but the querySelector is always empty. It is working for other component which are not extended. I want to ...
q-jack's user avatar
  • 194
0 votes
1 answer
177 views

LWC - @api property does not render on child component

I have a 4 layers LWC component: great-grandparent > grandparent > parent > child. I want to pass an @api property from great-grandparent to display and modify data in child. Because the ...
Pam's user avatar
  • 107
0 votes
1 answer
571 views

My child component does not re-render when parent data is changed in LWC

So I have situation where my Parent gets info from Child Component 1 and passes that to Child Component 2. Getting from Child Component 1 to Parent is okay as per console.log(), but my Child Component ...
Greckon121's user avatar
0 votes
1 answer
28 views

JS api decorative is not working in LWC

the @api decorative is not working in LWC, below is piece of code. the msg is not displaying the text from parent. please help me to fix this error. I am using vs code. parent.html <template> ...
Kuppala's user avatar
0 votes
1 answer
123 views

How do I check if LWC component has a public method

I have a form with inputs being either standard LWC inputs or custom lookups. I want to validate the form and report error back to the user. I use this.template.querySelector to get the inputs and ...
user682217's user avatar
  • 1,171
0 votes
1 answer
104 views

How can you use getSObjectValue() in a child component who's property is declared with @api?

Summary: Is there a way to pass an object from a parent component to a child component so that the child component can use getSObjectValue() to read field values? The naïve implementation fails ...
kennyc's user avatar
  • 307
1 vote
1 answer
382 views

Error handling if no data from parent to child LWC

I am new to salesforce and javascript. I am passing an object from parent LWC to child LWC. but some fields in the object are empty or null. Since I am directly accessing them in the child component ...
CodeGirl's user avatar
0 votes
1 answer
291 views

Advice for validation approach LWC

Hello guys I have being working on a LWC custom form that includes several child components, where each of them contains lightning-inputs, lightning-comboboxes, etc... And in the parent component I ...
TechGuy's user avatar
  • 97
0 votes
1 answer
429 views

LWC Run Event Child Then Reun Even on Parent

In my parent LWC I have a modal which displays a child compoent. When the User clicks the Save & Close button I want to fire the Submit event on the Child which then fires a Success Event. Once ...
Jeff Callahan's user avatar
-1 votes
1 answer
864 views

You have a parent LWC Component A which has two child LWC components B and C. How would you communicate between B and C?

I was asked this question and answered as follows : I would fire a custom event from child B, I would catch the event in the handler of Parent A and retrieve the value in the handler from event.detail ...
Amax1's user avatar
  • 109
1 vote
1 answer
145 views

ChartJS Axes Callbacks not able to be passed from Parent to Child component

I am using ChartJS to display numerical values and I am looking to modify the Axes labels to display with commas. I want to do so by having the chart config look like: var xyValues = [ {x:50, y:7},...
Blake's user avatar
  • 121
1 vote
1 answer
296 views

LightningModal extract first Element from Array to use in String

On my Parent Lightning Element I have a data table where on Row Selection I want to open a custom Record Page in a Lightning Modal. I am struggling to extract the Id I am passing in the options array. ...
Jeff Callahan's user avatar
0 votes
1 answer
215 views

LWC - Run Event on Child when Datable Row Selected on Parent

I am trying to run an Event on my Child Component when the Datable row is selected on my Parent Component. I am receiving the error below Here is the Event code from my Child Component handleCancel(...
Jeff Callahan's user avatar
0 votes
2 answers
1k views

LWC dynamically render components and call method for each

I have a parent lwc component and child lwc component.I need for each item in dataList display child component and then call method for each child component. How can I do it via lwc? Its easier via ...
waviko's user avatar
  • 5
1 vote
0 answers
318 views

This is a parent-child communication question from LWC combobox!

I'm a beginner at lwc! When you select an object from a combo box created by a parent component, you want to load the fields corresponding to the selected object into the combo box created by the ...
Yeonbi Ji's user avatar
0 votes
1 answer
152 views

Querying parent's related list from the child object

I just wonder if this is possible and cannot find anything online about it, so imagine the following scenario: Let's say we have a parent object named Parent__c and it has 2 related lists of objects: ...
SkyAnthrax94's user avatar
0 votes
1 answer
127 views

Multibrand Parent & Child BUs - Contact management & profile center

A potential client has a Parent BU, in which seats the data of one of their brands, and a Child BU in which seats the data of the other brand. They currently have an issue of unsubscription, since ...
Elodie Lapp's user avatar
0 votes
2 answers
576 views

Create Master-Detail Object via Rest-API

I have created a custom object which is connected to the Account Object via Master-Detail. The custom object stores reviews for the Accounts. The reviews are given on a website and saved via REST API. ...
Fewture's user avatar
0 votes
1 answer
659 views

LWC @api is not working in experience builder while logged in as community user

the main problem i have with this, is that it works well when i'm editing builder as Admin, but when i try to log as specific user, the ID's are not passed within the LWC'c I will show on example: ...
matistikoff's user avatar
2 votes
1 answer
303 views

How to use refreshApex on Parent Components?

what i am trying to achieve is, when i edit an account to active = 'Yes'. My LWC component show refresh dynamically and show that active account when i click show active accounts button, but its not ...
Naveen's user avatar
  • 65
-1 votes
2 answers
3k views

Write a code to pass a user input given in an Aura component to a child LWC component [closed]

So there is a Parent Aura component and a Child LWC component. I have to take a user input in the Parent Aura component, and now in the child LWC component, I have to show that input. I am pretty new ...
TheGeekGuy's user avatar
1 vote
3 answers
457 views

Cant map parent-child SOQL To Map<Id, Set<Id>>

Hi Im kind of stucked here, What Im trying to do is getting a Map which for each key (Id) will have a set of related objects. Map<Id, Set<Id>> junctMap = new Map<Id, Set<Id>>([...
SamLProgrammer's user avatar
0 votes
1 answer
3k views

In LWC JSON.parse(JSON.stringify(array)) not working as expected

I have an LWC that calls the backend, which makes a callout and returns the response wrapped inside an inner wrapper class with @AuraEnabled member variables and this wrapped class's @AuraEnabled ...
nSv23's user avatar
  • 544
-1 votes
1 answer
2k views

Access lightning-record-edit-form fields from parent LWC

I have a child component with a lightning-record-edit-form that should work as a standalone component and as a child component as part of another flow. The form takes inputs from users and then, with ...
Michael Imas's user avatar
0 votes
1 answer
1k views

LWC: setting child component width dynamically from parent

i'm doing this tutorial on "Parent To Child Component Communication Using LWC" (added with time markers: https://youtu.be/eiTPjZ5nL2w?t=3134 The issue is this error: As this is in the ...
Luis Aguiar's user avatar
0 votes
1 answer
430 views

Save Parent - Child Hierarchy for same SObject in a single DML

I want to save the lookup relationship for same object in a single DML statement, so basically I want to do something similar like this but for same Sobject, I have found one article here but this is ...
Akash Jain's user avatar
0 votes
1 answer
2k views

How to reset child combo box values on button click in parent LWC

I have Parent component LWC where I am displaying account records in html table and having filters for picklist where I have used combo box(Util combo box) . When I select the values in picklist it ...
priyasfdc's user avatar
0 votes
0 answers
1k views

Updating Account owner based on Territory2 and Account relationship

This is my Pseudocode Trigger on Territory2 before Update If IsChanged (UserTerritory2Association.User) Get AccountID of the Account assigned to the Territory from ObjectTerritory2Association Get ...
GroundToCloud's user avatar
0 votes
1 answer
2k views

LWC - Child not being updated from Parent

I have a picklist and when it is updated, it calls an Apex method to fetch new values for the child to render. However, the child component only loads initially when the page is rendered. After, when ...
some guy's user avatar
  • 141
1 vote
1 answer
2k views

Update JSON value in child component sent by parent component LWC

Im passing a JSON from parent component to child component in LWC and I want to update the JSON in child component how can I do that? I think @api decorator is the cause that the JSON cannot be ...
Tejas's user avatar
  • 57
0 votes
2 answers
611 views

Aura : Passing attribute across different components in containment hierarchy

I am trying to get the user's profile from Apex Controller once and re-use it across multiple components. I have a grandParent.cmp which creates a Parent.cmp. After the user does some selection on ...
SfdcBat's user avatar
  • 4,761
1 vote
1 answer
317 views

Operating between two parents of a junction object

I have say object A, B and C with A and C as parent object and B as a junction object. What I want is- whenever a B is created between A and C, a field named field__c on A should be transferred to C ...
Ashutosh Srivastava's user avatar
0 votes
1 answer
583 views

Help with Parent-Child relationship in apex class

I created the following trigger. trigger Update_Case_Subject on Case (before insert) { for (Case c : trigger.new){ c.Subject = RecordType.DeveloperName + ' - ' + Account.JA_Account_ID__c + ...
JTG463's user avatar
  • 1
1 vote
1 answer
441 views

LWC not able render Html tag in JS?

How to pass html tag from parent to child component in LWC ? Parentcmp.js msg ='' init() { this.msg =`<h1>Watch out!</h1><p>Unauthorized hockeying can result in penalties of ...
New learn's user avatar
0 votes
1 answer
138 views

Need help with Subquery in parent-child relationship query

I have a query where I have to query contacts and their cases only if case status != "Completed" or "Pending". But in my Parent-child query, cases are getting retrieved ...
Rahul Allada's user avatar
0 votes
1 answer
153 views

How to use maps to get list of grand child records for a parent object

I have a parent object (Account), child object(Contract) and a grand child object(contract exceptions). Contract exceptions has master detail relationship with contract. My requirement is to fetch ...
Sudhir Balijepalli's user avatar
0 votes
0 answers
33 views

Is it possible to rerender pageblockSection located inside child apex:component?

I wonder if it is possible to rerender pageblockSection that is nested inside child apex:component. I noticed that rerender whole child visualforce component need wrapping it within some outputPanel ...
Grzegorz Połuch's user avatar
0 votes
0 answers
1k views

Best way to call child component in LWC

I am having a html table in my LWC. I have a tooltip displayed on hover on each table row. The content of the tooltip is placed inside the child component. Below is my code. <table class="slds-...
sfMon's user avatar
  • 39
1 vote
0 answers
36 views

Lifecycle hook for child component?

I understand lifecycle hooks for a custom LWC. But how do I detect when a child LWC has loaded in the DOM? For example, let's say I have a <lightning-datatable> that is a child of a custom LWC I'...
jbyrd's user avatar
  • 631
1 vote
0 answers
837 views

renderedCallback method in child component not recognized (undefined) when variable passed from parent component

I am trying to pass a variable from parent component to child component in LWC. But when I tried to access this variable in renderedCallback method of child component, it is showing loanId as ...
Utkarsh Maheshwari's user avatar
1 vote
1 answer
874 views

Using Wire in a Child Lightning Web Component

I'm trying to build a TabSet form where each child component is a different form. I would like to use @wire in the child components to grab the object needed for the form. However, I can only get it ...
thinker's user avatar
  • 1,402
0 votes
1 answer
327 views

How would I go about creating parent/child records on a custom object? [closed]

I'm trying to import a list of grant awardees. I have a custom object called Grant, in which I will import all of the various grants (Grant A, Grant B, Grant C, etc.). I could create a custom object ...
Derrick's user avatar
0 votes
1 answer
1k views

Render Child Component again with a Change on Parent

I am trying to do display some data in the child component from Parent Component where my parent Component has an object variable that am using to display on my child component. Here's Simple Snippet: ...
user102266's user avatar
0 votes
2 answers
2k views

Unable to send @api Object variable or array in LWC from parent to Child

Please help whenever I am trying to pass the object then it is not getting passed from Parent to Child but if I am passing string values then it is getting passed to child component. Please help. ...
user91530's user avatar
1 vote
1 answer
1k views

Issue with lightning-record-edit-form event order of execution between Parent and multiple Child LWCs on Submit

I'm new to LWCs development. I'm having an issue understanding the order of execution for the lightning-record-edit-form component when a Parent lwc has multiple Child lwcs. Each Child component ...
dwaynej2346's user avatar
0 votes
1 answer
4k views

Trying to refresh child LWC Data from parent component new values

I'm trying to pass the new data from a parent LWC to a child. The data is a list of wrapped objects with the following properties: string, string, list, list. I'm able to send and it renders perfect, ...
AjFmO's user avatar
  • 282
0 votes
1 answer
205 views

Why ExternalID field of parent Account is null?

I have the next code on my test Class: parentAcc.ExternalId = '001'; insert parentAcc; System.debug('parentAcc ExternalId' + parentAcc.ExternalId); childAccount.ParentId = parentAcc.id; insert ...
CPS's user avatar
  • 335
0 votes
1 answer
3k views

How to embed one lightning web component in another web component

I have a component where i need to embed it to another component i am getting the below error No MODULE named markup://c:lifeCycleChild found : [markup://c:lifeCycleParent] Below is My code : 1st ...
SFDCSai's user avatar
  • 147
0 votes
2 answers
2k views

Unable to pass an array from parent LWC to child LWC setter method

Trying to pass a array value from parent component to child component using setter method in child LWC but empty value is being passed to child setter method. I am Using parent LWC as a quick action. ...
Sudhir Balijepalli's user avatar
1 vote
1 answer
611 views

Parent LWC cannot set a child JS Property

Main LWC HTML: <template> <c-product-code-entry onproductidchanged={passProductIdToDisplayPanel}></c-product-code-entry> <c-stock-display-panel></c-stock-display-...
Sudesh Shirole's user avatar