You need to sign in to do that
Don't have an account?
Rick MacGuigan
Determine if an account has any related records
I need to remove accounts that have no related list records (i.e. contact, custom object records,..) What is the easiest way to flag an account record with a field that calcualtes to a '1' or '0' (has records / does not have records?)
I do have rollup helper but would prefer to use a formula field if possible.
I do have rollup helper but would prefer to use a formula field if possible.
I think you can create a child_count one field in Account and write trigger in all child object to update the same field .
Write a batch class to check the child count an dif the child count is zero then delete teh account .
However you need to decide the time when you need to execute the batch .
Thanks
Manoj
Create rollup fields on the parent record that count the number of child records of each type.
You'll be able to report against them and work out what IDs need to be removed.
cheers,
Keith
You could consider A Declarative Rollup Summary Tool for Force.com Lookup Relationships (https://success.salesforce.com/_ui/core/chatter/groups/GroupProfilePage?g=0F9300000009O5p).
I have not used it myself, yet, but seems very popular.