You need to sign in to do that
Don't have an account?
Sai Teja 7557
How to Fetch values from Child Component on button click of Parent Component
Hey everyone,
I have two components. one is a child where we collect the data for different types of fields. one is Parent where we have some buttons. when we enter the data in the child component upon clicking the save button on the Parent component it should create records in salesforce and also it should hold the saved values. Please refer to the below picture for a better understanding. Thanks in advance,
Sai Teja
I have two components. one is a child where we collect the data for different types of fields. one is Parent where we have some buttons. when we enter the data in the child component upon clicking the save button on the Parent component it should create records in salesforce and also it should hold the saved values. Please refer to the below picture for a better understanding. Thanks in advance,
Sai Teja
Follow below code:-
parentLWC.html:
parentLWC.js:
parentLWC.js-meta.xml:
childCmp.html:
childCmp.js:
childLWC.js-meta.xml:
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
This is updated
Follow below code:-
parentLWC.html:
parentLWC.js:
parentLWC.js-meta.xml:
childCmp.html:
childCmp.js:
childLWC.js-meta.xml:
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh