Find the best tutors and institutes for Salesforce Certification

Find Best Salesforce Certification Training

Please select a Category.

Please select a Locality.

No matching category found.

No matching Locality found.

Outside India?

Search for topics

Following Custom Objects Are Available In The Organization: Interview Question For Salesforce

05/08/2017 0 0



Click to see the full question.

Relationship between ChildObject__c and ParentObject__c objects is Lookup relationship.

In case of lookup relationship if we delete the parent object record in child object only the relationship field value will be removed (child records won't be deleted).

But client has a requirement to delete the child object records. How to achieve this?

Write an apex trigger to achieve this functionality.

We should take before delete event. If we take after delete relationship will broke up b/w parent and child object records.

Trigger ParentTrigger on ParentObject__c(before delete) {



  • For delete events only trigger.old and triggger.oldMap will be available.

  • trigger.old holds old versions of the records but if we mention that in SOQL query salesforce will automatically convert those records into ids.


   List childLst = [select id, Parent_Object__c from ChildObject__c where Parent_Object__c in: trigger.old];  

   delete childLst;


0 Dislike
Follow 0

Please Enter a comment


Other Lessons for You

Starting Career as Salesforce Admin
Hello Everyone! This is just an introductory lesson for those who want their career as Salesforce Admin. Being a Salesforce Admin, you do not need any prior experience on CRM. What you all need is the...

Devika G. | 19/04/2018

0 0

Salesforce Certification Course
Basics of Cloud Computing: Overview of each of three building blocks in cloud applications SAAS PAAS IAAS Different Cloud Service providers Salesforce Architecture: Introduction...

Difference Between Data Loader And Import Wizard In Salesforce
Difference between Dataloader and Import Wizard in Salesforce: Dataloader Import Wizard It supports more than 50000 records. It supports only up to 50000. It supports...

Siva Sankar | 07/02/2018

0 0

Java To Salesforce Connection
Java to Salesforce Connection Step 1: Generate or Obtain the Web Service WSDL To generate the WSDL file for your organization: Log in to your Enterprise, Unlimited, or Developer Edition Salesforce...

Siva Sankar | 07/02/2018

1 0

Before Take Salesforce Training Need To Ask Below Things
In every platform technology will be follow below things: i. Software Development Life Cycle--------SDLC having diffrent METHADOLOGIES (Salesforce SDLC -- Agile and Agile with SCRUM) What is the difference...

Siva Sankar | 07/02/2018

1 0

Find Best Salesforce Certification Training?

Find Now » is India's largest network of most trusted tutors and institutes. Over 25 lakh students rely on, to fulfill their learning requirements across 1,000+ categories. Using, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 6.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more