You can't track the outbound emails as it is not stored any where.However,you can track Inbound emails as it is stored in EmailMessage object.You can query on this object as below :-
EmailMessage em = [select FromName,HtmlBody from EmailMessage where parentId=<seome case id>];
Please go through the belwo link to get all fields on EmailMessage.
Actually I want to count the number of Inbound & Outbound Emails for all Cases. I don't have specific case id to be inserted in where clause of query. Its just like counting Inbound & outbound mails associated with cases only.
Hi,
You can't track the outbound emails as it is not stored any where.However,you can track Inbound emails as it is stored in EmailMessage object.You can query on this object as below :-
EmailMessage em = [select FromName,HtmlBody from EmailMessage where parentId=<seome case id>];
Please go through the belwo link to get all fields on EmailMessage.
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_emailmessage.htm
Actually I want to count the number of Inbound & Outbound Emails for all Cases. I don't have specific case id to be inserted in where clause of query. Its just like counting Inbound & outbound mails associated with cases only.