How to delete child record in Lookup by w3web.net

How to return data from multiple objects using wrapper class in lightning component | wrapper class instances in lightning component to return data from multiple objects and delete selected row on click delete button in Salesforce

Hey guys, In this post we are going to learn about how to write inner query in Salesforce. And how to fetch data from multiple custom sObject using wrapper apex class in lightning component.

Also in this example we will achieving that how to delete child record if child record has a lookup relationship to the parent sObject.

 

Files we used in this post example →

wrapperCustomObjCmp.cmp Lightning Component It is used for display the Input filed of name, address, email, and button Icon of delete on the table.
wrapperCustomObjCmpConroller.js JavaScript Controller File It is used for communicate to server side apex method and fetch the record using init fuction.
wrapperCustomObjCmpHelper.js JavaScript Helper File It is used for refresh the page after delete the record.
wrapperCustomObjCmp.CSS Component Style CSS It is used for creat a custom delete icon from resource.
wrapperCustomObjCtrCmp.apxc Apex Class Controller It is used for delete and fetching the records from multiple sObject from database server

Custom Parent Object:- NewStudent__c

Custom Parent Object Fields:-

Name,

Email__c

Address__c

Custom Child Lookup Object:- Registration__c

Custom Child Object Fields:-

Name,

RegNewStudent__r.Name

RegCourse__r.Name

DateOfRegistration__c

Custom Object and their fields In this post we used two type of custom sObject. first is Parent object (NewStudent__c) and another is child sObject (Registration__c). We are achieving that how to fetch records from two custom objects and how to delete child record in Lookup relationship..

Final Output →

fetch data from multiple object in lightning component -- w3web.net

Other related post that would you like to learn in lightning component.

Create Lightning Component →

Step 1:- Create Lightning Component : wrapperCustomObjCmp.cmp

From Developer Console >> File >> New >> Lightning Component >> wrapperCustomObjCmp.cmp

wrapperCustomObjCmp.cmp [Lightning Component File]

Create JavaScript Controller →

Step 2:- Create Lightning Component : wrapperCustomObjCmpConroller.js

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

wrapperCustomObjCmpConroller.js [JavaScript Controller]

Create JavaScript Helper →

Step 3:- Create Lightning Component : wrapperCustomObjCmpHelper.js

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

wrapperCustomObjCmpHelper.js [JavaScript Helper File]

Fetch record from multiple object by w3web.net

Create Component Style CSS →

Step 4:- Create Lightning Component Style CSS: wrapperCustomObjCmp.CSS

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

wrapperCustomObjCmp.CSS [JavaScript Helper File]

Note:-Static resource custom delete icon

You need to upload a custom delete icon on resource file.

Create Apex Class Controller →

Step 5:- Create Apex Class : wrapperCustomObjCtrCmp.apxc

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

wrapperCustomObjCtrCmp.apxc [Apex Class Controller]

Further post that would you like to learn in lightning component.

To Find Some Important Additional Information
If you think you and your family members also like to earn money in additional time, then go this link. In this site, you can earn money for the lifetime at low effort. To Earn Unlimited Everyday With This Trick, Sign Up Free and Get Magic.. Get Started for Free

Hi, This is Vijay 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

8 thoughts on “How to return data from multiple objects using wrapper class in lightning component | wrapper class instances in lightning component to return data from multiple objects and delete selected row on click delete button in Salesforce”

Leave a Comment