function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
trigger DeleteChildRecords on Object_1__c (before delete) { Set<Id> obj1ids= new Set<Id>(); For(Object_1__c obj:Trigger.old){ obj1ids.add(obj.id); } If(obj1ids.size()>0){ List<Object_2__c > objtobedeleted=[select id,Name from Object_2__c where Child_Of__c in:obj1ids]; if(objtobedeleted.size()>0) delete objtobedeleted; } }
Can you try the below trigger on Object_1__c
Let me know if you face any issues.
If this solution helps, Please mark it as best answer.
Thanks,