Questions tagged [parent-to-child]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
62 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 ...
  • 149
1 vote
1 answer
52 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 ...
0 votes
1 answer
42 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 ...
  • 77
0 votes
1 answer
40 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 ...
-1 votes
1 answer
202 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 ...
  • 63
1 vote
1 answer
57 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},...
  • 81
1 vote
1 answer
76 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. ...
0 votes
1 answer
109 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(...
0 votes
2 answers
476 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 ...
  • 5
1 vote
0 answers
209 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 ...
0 votes
1 answer
73 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: ...
0 votes
1 answer
46 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 ...
0 votes
2 answers
280 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. ...
0 votes
1 answer
341 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: ...
2 votes
1 answer
84 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 ...
  • 55
-1 votes
2 answers
976 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 ...
1 vote
3 answers
265 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>>([...
0 votes
1 answer
2k 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 ...
  • 494
-1 votes
1 answer
1k 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 ...
0 votes
1 answer
879 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 ...
0 votes
1 answer
231 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 ...
0 votes
1 answer
1k 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 ...
0 votes
0 answers
374 views

Calling method on child component not passing data LWC

I want to put an anchor tag on my parent component html that will open up a modal when a user clicks on '{iteratorname.value.LineStatus}' Right now it opens the modal but no data is showing up, and it ...
0 votes
0 answers
702 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 ...
0 votes
1 answer
1k 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 ...
  • 121
1 vote
1 answer
1k 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 ...
  • 57
0 votes
2 answers
333 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 ...
  • 4,661
1 vote
1 answer
191 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 ...
0 votes
1 answer
484 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 + ...
  • 1
1 vote
1 answer
317 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 ...
0 votes
1 answer
125 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 ...
0 votes
1 answer
111 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 ...
0 votes
0 answers
32 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 ...
0 votes
0 answers
882 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-...
  • 29
1 vote
0 answers
21 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'...
  • 581
1 vote
0 answers
604 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 ...
1 vote
1 answer
494 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 ...
  • 1,380
0 votes
1 answer
222 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 ...
0 votes
0 answers
632 views

Related list of child object not showing in parent Object

Correct me if im wrong, In my knowledge I have to create a look up Account field in the child object for the related list appear in Parent Object (account) but it is not showing in Parent. Is my ...
0 votes
1 answer
952 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: ...
0 votes
2 answers
1k 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. ...
1 vote
1 answer
752 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 ...
0 votes
1 answer
3k 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, ...
  • 262
0 votes
1 answer
134 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 ...
  • 185
0 votes
1 answer
2k 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 ...
  • 107
0 votes
2 answers
1k 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. ...
1 vote
1 answer
430 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-...
0 votes
2 answers
1k views

LWC Child Methods on Child Component

I am new to lwc. I have a method in the child component which returns a string. I called the child method from the parent components but it fails to return the string to the parent component. Did I ...
0 votes
1 answer
538 views

Get all child recrods

I have object Sales with self relationship. I want to ger Parents and all Child, but it has multiple level hierarchy. To get Parent i just search for recotd with Parent__c = null. To get Child i ...
  • 3
1 vote
1 answer
1k views

Validation Rule on Parent Object blocking any activity on Child records?

I have a Validation Rule on Account, that when reaching a certain stage, several fields need to be filled out. A user couldn't log activities on Contact related to this account due to this Validation ...
  • 39