Here is the sample code to real all attachments.
public static EntityCollection GetAllNotes(Guid CaseId, IOrganizationService _service)
{
EntityCollection results = null;
try
{
QueryExpression _Query = new QueryExpression
{
EntityName
= "annotation",
ColumnSet
= new ColumnSet(true),
Criteria
= new FilterExpression
{
FilterOperator
= LogicalOperator.And,
Conditions
=
{
new ConditionExpression
{
AttributeName
= "objectid",
Operator
= ConditionOperator.Equal,
Values
= { CaseId }
},
}
}
};
results
= _service.RetrieveMultiple(_Query);
}
catch (Exception Ex)
{
}
return results;
}
Hope this helps to someone :) !!!
No comments:
Post a Comment