Wednesday, November 09, 2011

Tutorial: Debugging AX while still using restricted roles (non-admin)

Saw this on our internal forum today, and thought it's a nice thing to share with all of you.


1.       Close All AX instances

2.       Open AX Development Environment (ax32.exe -development)

3.       Open AX Application (ax32.exe)

4.       Add Role that you would like to test to your UserId

a.       System Administration > Common > Users

b.      Find yourself and double click to get to the detail window

c.       Assign role that you want to test

5.       Close AX Application

6.       Set break points in AX Development Environment

7.       Create a job and add this line

             SecurityUtil::sysAdminMode(false);
 
8.       From the AX Development Environment “Ctrl W” to open the application

9.       You are now in a reduced permission user and have the ability to debug. J
 

To get your environment back to full admin, re-execute the job in step 7 with a true.


Note: This will not work for EP, Services, direct BC.NET and cases using runas(), as the SecurityUtil::sysAdminMode is limited to the current session.


Ed Budrys from our Security team deserves the credit for the above.

Let me know if you found this to be useful.
Thanks

3 comments:

  1. hi vanya,
    this is a bit unrelated problem ... but i cant find a similar entry and post a question there..
    anyways..
    we run ax4.0 . when i create pick list lines for work orders, in production, there is a delay of about 15-30sec before the picklist report (ProdPickList)appears on the screen. it happens first thing in the morning when you create lines for your first picklist, than its back to normal. i run a profiler, and it seems that the wait is at InventUpdateOnhandGlobal class, line 6, on insert method of inventUpdateOnhandMap - which should be just an instance of inventupdateOnhand class. both classes run on CalledFrom..
    how do i optimize that, and why is it happening?
    there is an user where there is a delay everytime she needs to create a new picklist and print it, and thats consuming a lot of time from her work.
    i have tried to set the menuItem for that report to run on server, but no improvement..
    any thoughts?
    any help will be appreciated
    thanks
    pedja
    pnikodijevic@viscor.com

    ReplyDelete
  2. This is a life saver, thanks!

    ReplyDelete
  3. Switching between roles was never easy.. This tip is REALLY a handy one! Will save a lot of time and effort. Thanks much! :)

    ReplyDelete

Please don't forget to leave your contact details if you expect a reply from me. Thank you