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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

CRM 2011 - CreateOnBehalfOf using SDK

(0) ShareShare
ReportReport
Posted on by

Hello -

I am trying to create an account in Dynamics via SDK. I'm creating a proxy as a different user to "createonbehalfof"... like this.

http://www.powerobjects.com/2012/08/06/how-to-impersonate-in-microsoft-dynamics-crm/

I'm setting the caller ID to one user, but the account is still being CREATED BY the service account hooked up through the service.

In our production environment, it works fine. In Beta, it is replicating like described above. What debugging techniques can i perform? In 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Emre GULCAN Profile Picture
    2,379 on at

    Hi,

    Did you check your plugin's "Run in User’s Context" property, maybe this is not "Calling User".

    Please check this msdn.microsoft.com/.../hh237515(v=crm.6).aspx

  • Community Member Profile Picture
    on at

    Hi -

    thank you for the suggestion! Unfortunately, i cannot dig into the plugins more than i can see in the sdk message processing steps. i'm unsure of how to open them. and i'm not sure which revision of our code is deployed. Is there a way to reverse engineer these plugins and pull the code out of what's actually in dynamics?

  • Suggested answer
    Emre GULCAN Profile Picture
    2,379 on at

    Hi,
    You don't need code to check "user context" that I told. Just use Plugin Registration Tool and find your related plugin and step, after that check "Run in User’s Context" property inside Plugin Registration Tool.

    You can also reverse eng. your assemblies however I'm not sure about their health. You can check "Assembly Recover Tool" and also https://crmbusiness.wordpress.com/2015/08/13/crm-2015-how-to-decompile-plugin-code/ 

  • Community Member Profile Picture
    on at

    Yeah.. plugins look to be the exact same between the two environments. Any other suggestions?

  • Suggested answer
    Community Member Profile Picture
    on at

    Few options:

    1.Changing the settings in plugin steps (run as user, execution user whatever...)

    2.Modify the plugins code for execution user

    IOrganizationService service = factory.CreateOrganizationService(<USERID>);

    3.If it is just createdby, you can try assign value to the overwrite createdby field (you need to grant some privilege). Try google you will find the answer.

  • Suggested answer
    Nithya Gopinath Profile Picture
    17,078 on at

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans