You need to sign in to do that
Don't have an account?

we have three type of contact ,how to filter based on condition
I have three types of contact that are level1, level 2, and level 3, and level 2 and level 3 are linked to level 1
here I want to write a class and I want to filter it based on like
Delete Level 1 Contact which does not have Levels 2 & 3 and level 1 email have 'levelone@gmail.com'
Please give the suggestion on how to write the SOQL for this scenario
Thanks
Please frame the query properly, as per your query you mentioned here
if level2 and level3 are linked to level1 there might some come field or relation among themselves
i think for this you could write a trigger by comparing the contact ids of level1,level2 and level3
or else you could also call the linked level2 and level3 records through parent to child relationship SOQL Query.
Can you please write the SOQL query for that
and the relationship field names " Parent_Member_Name__r"
thanks in advanced