web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

GrantAccessRequest doesn't share records sometimes

(0) ShareShare
ReportReport
Posted on by

Hi,

I'm using the GrantAccessRequest class to share records with users/teams within a custom workflow activity, but sometimes it doesn't share the record but the workflow status is succeed and the code doesn't throw any exception.

We create the records that trigger the workflow with a custom application that syncs the data from NAV to Dynamics 365. 

I've seen the class documentation says: For this message to work, the caller must be connected to the server

  1. I don't totally get what means: For this message to work, the caller must be connected to the server, the caller would be the user we use with the custom sync app?
  2. Is there any other way to share records?
  3. Any way to find out if GrantAccessRequest doesn't share the record?

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Emre GULCAN Profile Picture
    2,379 on at
    RE: GrantAccessRequest doesn't share records sometimes

    Hi,

    As SDK documentation of GrantAccessResponse (msdn.microsoft.com/.../microsoft.crm.sdk.messages.grantaccessresponse.aspx) "There is no return value from this operation", so you can't handle any response. However if your request is faulted there is an exception occurs when you execute this request.

    Maybe you doing something wrong, please check your code and replace it sample below;

    GrantAccessRequest request = new GrantAccessRequest()
                {
                    PrincipalAccess = new PrincipalAccess()
                    {
                        Principal = new EntityReference("systemuser", Guid.Parse("YOUR_SYSTEMUSER_ID")),
                        AccessMask = AccessRights.AppendAccess | AccessRights.AppendToAccess | AccessRights.AssignAccess | AccessRights.CreateAccess | AccessRights.DeleteAccess | AccessRights.ReadAccess | AccessRights.ShareAccess | AccessRights.WriteAccess
                    },
                    Target = new EntityReference("YOUR_ENTITY_LOGICALNAME", Guid.Parse("YOUR_ENTITY_RECORD_ID"))
                };


  • Jorge S Profile Picture
    on at
    RE: GrantAccessRequest doesn't share records sometimes

    No exception.

    I'm trying to get the reponse from

    GrantAccessResponse response = (GrantAccessResponse)service.Execute(grantRequest);

    but both response.Results.Keys and response.Results.Values are empty.

  • Emre GULCAN Profile Picture
    2,379 on at
    RE: GrantAccessRequest doesn't share records sometimes

    Hi

    Did you get any exception? Maybe your users don't have valid privilege on entity

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#2
Christoph Pock Profile Picture

Christoph Pock 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans