You need to sign in to do that
Don't have an account?
devloper sfdc
how to get number of case created by contact group by account
Hi All,
I need soql query to retrive number of Cases created by Contact in an accounts.
I need soql query to retrive number of Cases created by Contact in an accounts.
Try the below and this should get you what you need.
List<Aggregateresult> sl = [select count(id),contact.LastName,Account.Name from case GROUP BY contact.LastName,Account.Name ];
Please mark as best answer if the above helps..!!!
Thanks for reply i need to update contact field total_no_of _case__c . it is posiblle?
Please find the solution below
where ContactIdSet is a set of contacts id for which u want to count the cases related to it
Thanks .
Please let us know whether ur problem is solved or not?