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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Custom Action runs in User Context or System Context?

(0) ShareShare
ReportReport
Posted on by

Hi All,

I have one custom action which internally updates Order Entity. Now, the problem is when user clicks on button and custom action is triggered, user gets error message saying AccessRight is missing. Now, the order entity belongs to different user and different BU. So my user needs Global read on Order so that he can successfully trigger custom action.

But giving global right is not possible as client doesn't want to do that. 

What is the solution? Custom action runs in user context even if the custom action owner is admin?

*This post is locked for comments

I have the same question (0)
  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    You can do following:

    1. Call that action impersonating as other user - msdn.microsoft.com/.../mt607702.aspx

    2. Redesign your action and develop a plugin for that action, do your operations with Order using "System" IOrganizationService instance.

    3. Change your action to on-demand real-time workflow and call it on click of button. Configure workflow to run under user with elevated permissions.

  • Verified answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi,

    I am assuming  you are calling custom action using JavaScript Web API request ,  set the MSCRMCallerID  with impersonated user id like below.

    req.setRequestHeader("MSCRMCallerID", "28888439-85AF-E511-80EB-3863BB35AD90");

    https://debajmecrm.com/2016/01/05/dynamics-crm-web-api-impersonate/

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans