Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum

RetrieveEntityChangesRequest for attachment

Posted on by 65

I am using CRM Dynamics 365 online,

When I am trying to use the RetrieveEntityChangesRequest in C# it works well for all entities except attachment and activityMimeAttachment (attachment that is attach to mail or other activities), in those entities i am getting the following message:

You don't have sufficient privileges to access attachment entity

The problem is that there is no option to add privileges to that entities at all, more over I created security role with all privileges in organization level still getting the same error, but when I am trying to do the same action with system admin security role its working.

Someone as a clue?

  • Johnny Gong Profile Picture
    Johnny Gong 6,482 on at
    RE: RetrieveEntityChangesRequest for attachment

    Hi oriel,

    I believe this 'attachment' and 'activityMimeAttachment' should be hard coded in Admin Security Role. You could copy the system admin role and add your customizations to create a new role for Development. While if you want the RCA for this , I would suggest you to raise a ticket for this question since D365 BE Team could help figure out these two entities access privilege from Azure DB which is much close to by-design question.

    In addition , I add a digression that setting attachmentId is not allowed while creating Attachments. Following sample code can be used to create attachment while passing activitymimeattachmentid.

    Entity _sampleAttachment = new Entity(ActivityMimeAttachment.EntityLogicalName);
    				_sampleAttachment.Attributes.Add("activitymimeattachmentid", new Guid("586f7952-e065-e811-810a-3863bb2e34e0"));
    				_sampleAttachment.Attributes.Add("objectid", new EntityReference(Email.EntityLogicalName, emailId));
    				_sampleAttachment.Attributes.Add("objecttypecode", Email.EntityLogicalName);
    				_sampleAttachment.Attributes.Add("body", System.Convert.ToBase64String(new ASCIIEncoding().GetBytes("Example Attachment 12")));
    				_sampleAttachment.Attributes.Add("subject", String.Format("Sample Attachment adding new guid {0}", currentTry.ToString()));
    				_sampleAttachment.Attributes.Add("filename", String.Format("ExampleAttachment{0}.txt", currentTry.ToString()));
    				var _emailAttachmentId = proxy.Create(_sampleAttachment);

    Regards
    Johnny

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans