Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

How to Look the relation or entity from ribbon button ?

Posted on by 195

I have form request transfer that have Share button on the ribbon, so when i click share i will select user that will be shared my request transfer so the users can write, read etc. One request transfer can be shared to many users and one users can have many request transfer so the relation is many to many. I have requirment to share the request transfer to user if several condition fulfilled, but the problem is i can't found the relation between users and request transfer since the share button is from the system. On my solution i can't found many to many relation either on my request transfer. Can someone help me thanks share-request-transfer.png

*This post is locked for comments

  • Verified answer
    Arun Vinoth Profile Picture
    Arun Vinoth 11,613 on at
    RE: How to Look the relation or entity from ribbon button ?

    Basically you can use "GrantAccessRequest" to give access using Object based security model ie Share.

    All you need is Record Id, Team or User record Id, Access mask. You can issue "GrantAccessRequest" to CRM service & done.

                       // Grant the team read/write access to an account.

                       var accountReference = new EntityReference(Account.EntityLogicalName, _accountId);

                       var teamReference = new EntityReference(Team.EntityLogicalName, _teamId);

                       var grantAccessRequest = new GrantAccessRequest

                       {

                           PrincipalAccess = new PrincipalAccess

                           {

                               AccessMask = AccessRights.ReadAccess | AccessRights.WriteAccess,

                               Principal = teamReference

                           },

                           Target = accountReference

                       };

                       _serviceProxy.Execute(grantAccessRequest);

  • Keysersozeey Profile Picture
    Keysersozeey 195 on at
    RE: How to Look the relation or entity from ribbon button ?

    Woops already found the answer , using using Microsoft.Crm.Sdk.Messages,  in here docs.microsoft.com/.../sample-share-record-using-access-team

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans