Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

Can we change the current user Id using x++ in ax 2012

Posted on by 50

hi all,

i have a requirement that need to expose the business logic as services in ax 2012

when i submit the record from the connector , record is created through service account (admin)  

In workflow on record submission i am getting the message as ( "submitted by admin on behalf of abc "( which i am sending through connector))

the above is the result because current user id (admin) is different from submitted user id (abc).

to resolve this can we change the current user id as abc instead of admin..

Kindly help me to resolve this issue.

  • Verified answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,253 Super User 2024 Season 2 on at
    RE: Can we change the current user Id using x++ in ax 2012

    Hi Haini,

    You can run a full class in IL as of another user. Have a look at the command RunAs. Here is a blog with explanation: www.theaxapta.com/.../runas-in-dynamics-365-fo.html

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

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

Product updates

Dynamics 365 release plans