Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

What is the assembly name to use ActivityMimeAttachment Object ? - Retrieve Email Attachments

(0) ShareShare
ReportReport
Posted on by 228

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

https://social.microsoft.com/Forums/en-US/2c70e745-bd41-4b27-94e6-44685519ed49/custom-workflow-to-read-xml-attachment-crm-2011-online?forum=crm

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 

  • Milansinh Raj Profile Picture
    Milansinh Raj 228 on at
    RE: What is the assembly name to use ActivityMimeAttachment Object ? - Retrieve Email Attachments

    Thanks a lot @Bipin kumar

  • Verified answer
    Bipin D365 Profile Picture
    Bipin D365 28,961 Moderator on at
    RE: What is the assembly name to use ActivityMimeAttachment Object ? - Retrieve Email Attachments

    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.

    Please mark my answer verified if i were helpful

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,436 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans