Hello Everyone,
How to get FROM and TO value using c#, i have done the following code but it not retrieve FROM , TO from. thanks in advance.
var resultEmail = service.RetrieveMultiple(
new FetchExpression(
string.Format("<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>" +
" <entity name='email'>" +
" <attribute name='subject' />" +
" <attribute name='regardingobjectid' />" +
" <attribute name='from' />" +
" <attribute name='to' />" +
" <attribute name='prioritycode' />" +
" <attribute name='statuscode' />" +
" <attribute name='modifiedon' />" +
" <attribute name='activityid' />" +
" <attribute name='description' />" +
" <order attribute='subject' descending='false' />" +
"<filter type='and'>" +
"<condition attribute='regardingobjectid' operator='eq' value='{0}' />" +
" </filter>" +
" </entity>" +
"</fetch>", CaseId)));
if (resultEmail.Entities.Count > 0)
{
foreach (var attributenameEmail in resultEmail.Entities)
{
Description = attributenameEmail.Attributes["description"].ToString();
From = attributenameEmail.Attributes["from"].ToString();
To = attributenameEmail.Attributes["to"].ToString();
Subject = attributenameEmail.Attributes["subject"].ToString();
}
}