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
List<Account> Accounts=[select id,name,(select id,Lastname from contacts) from Account]; for(Account Acc:Accounts) { if(Acc.Contacts.size()>0) { //Contact exists for acc } else { //No contact for Acc } }
select Id,name from Account where Id not In (select AccountId from Contact)
Try this code
Let us know if it works.
Mark it as best answer if it helps.
Thanks.
All Answers
Try this code
Let us know if it works.
Mark it as best answer if it helps.
Thanks.
You can use SOQL to retrieve the accounts with no contacts.
Hope this helps you!
If this helps you please mark it as solved.
Thanks and Regards
Sandhya
How can i check if the contacts have email id