Hello Community,
I wanted tor retrieve Email Attachment from the D365 in C# code activity.
I found some blogs but the code which is mentioned on this blog is having object name as: ActivityMimeAttachment
But I am not able to resolve it by any assembly.
Do anyone know how to make this work?
Error: ActivityMimeAttachment does not exist in current context.
private EntityCollection GetAttachments(IOrganizationService service, Guid id) { //Query for the attachments QueryExpression query = new QueryExpression() { EntityName = ActivityMimeAttachment.EntityLogicalName, ColumnSet = new ColumnSet("filesize", "filename"), Criteria = new FilterExpression { Conditions = { new ConditionExpression { AttributeName = "objectid", Operator = ConditionOperator.Equal, Values = { id } } } } }; return service.RetrieveMultiple(query); }
Thank you,
Milansinh Raj
Thanks a lot @Bipin kumar
Hi,
There is no such assembly. This code is related to Early bound class which can be generate using SDK tool.
docs.microsoft.com/.../create-early-bound-entity-classes-code-generation-tool
You can replace below line
EntityName = ActivityMimeAttachment.EntityLogicalName
with
EntityName = "activitymimeattachment"
and it should work as expected.
Holly Huffman
103
Muhammad Shahzad Sh...
96
Most Valuable Professional
Gerardo RenterÃa Ga...
51
Most Valuable Professional