You need to sign in to do that
Don't have an account?
SNSN
How to delete all records except one from Child Object for each Parent Object record?
Hi,
I have requirement where we have to delete all the records except one from a child object for each Parent object.
Example : Parent object : A
Child Object : B
'A' object has 1 to many relation with 'B' Object.
For each 'A' record we have to delete all the related records except one from Object 'B' . The exception record can be any record in the child object.
Can somebody help me with SOQL query for this?
Thanks in Advance,
SNSN
This might not be what you are looking for but this is what I would do... I would export the data to microsoft access to manipulate.. I would add a field in access to mark all those that should be deleted using a query... then use the apex data loaded to delete....
Fred
Thank you very much for the reply!!