child to parent query for custom objects in salesforce --w3web.net

Retrieve data of Cross-object(Lookup/Master-Detail) from child to parent for custom objects and navigate to record detail page in lightning component Salesforce | How to fetch data of Cross object using SOQL query in salesforce

937 views

Hey guys, today in this post we are going to learn about How retrieve data of Cross-object(Lookup/Master-Detail) from child to parent for custom objects and navigate to record detail page in lightning component Salesforce.

Files we used in this post example

childParentCmp.cmp Lightning Component It is used for create a table for display the related list Values from child to Parent
childParentCmpController.js JavaScript Controller File It is hold Javascript doInit and navigate functionality to navigate on sObject record.
childParentCmpHelper.js JavaScript Controller Helper File It is hold for Javascript Helper Function Communicate to Related Queries Values (Child to Parent) from apex method
childParentCmpCtrl.apxc Apex Class Controller It is used for get SOQL query from Child to Parent from Apex Method

Live Demo

child to parent query for custom objects in salesforce -- w3web.net

 

Other related post that would you like to learn in Salesforce

 

Create Lightning Component

Step 1:- Create Lightning Component : childParentCmp.cmp

From Developer Console >> File >> New >> Lightning Component

childParentCmp.cmp [Lightning Component File]

Create Component JavaScript Controller

Step 2:- Create Lightning Component : childParentCmpController.js

From Developer Console >> File >> New >> Lightning Component >> JavaScript Controller

childParentCmpController.js [JavaScript Controller]

Create Component JavaScript Helper

Step 3:- Create Lightning Component : childParentCmpHelper.js

From Developer Console >> File >> New >> Lightning Component >> JavaScript Helper

childParentCmpHelper.js [JavaScript Helper File]

Create Apex Class Controller

Step 4:- Create Apex Class : childParentCmpCtrl.apxc

From Developer Console >> File >> New >> Apex Class

childParentCmpCtrl.apxc [Apex Class Controller]

Child to Parent query for custom objects in Salesforce -- w3web.net

Further post that would you like to learn in Salesforce

 

FAQ (Frequently Asked Questions)

What is lookup and master detail relationship in Salesforce?

Lookup and Master-detail both are types of relationships. In lookup, both objects are not sharing properties between them means loosely coupled. In Master-detail, both objects are sharing properties with each other means tightly coupled.

Can we convert master detail to lookup in Salesforce?

Yes, We can Convert Master Detail Relationship into Lookup.

What is difference between master-detail and lookup?

The Salesforce lookup relationship has no relation with other records. It does not depend on any other objects, whereas a master-detail relationship has an association with other records. On the other hand, the lookup relationship is just a reference. It can be even blank or NULL.

Related Topics | You May Also Like

  • Your reaction of the article ▾
 

Hi, This is Vijay Kumar behind the admin and founder of w3web.net. I am a senior software developer and working in MNC company from more than 8 years. I am great fan of technology, configuration, customization & development. Apart of this, I love to write about Blogging in spare time, Working on Mobile & Web application development, Salesforce lightning, Salesforce LWC and Salesforce Integration development in full time. [Read full bio] | | The Sitemap where you can find all published post on w3web.net

1 thought on “Retrieve data of Cross-object(Lookup/Master-Detail) from child to parent for custom objects and navigate to record detail page in lightning component Salesforce | How to fetch data of Cross object using SOQL query in salesforce”

Leave a Comment