Home > X++ stuffs > Enable/Disable keys using Task Macro in Dynamics AX

Enable/Disable keys using Task Macro in Dynamics AX

 

Hi,

 

Back again with one more small trick J. How to restrict access for users  perform any task on AX forms? I tried implementing this using Task macro.  Here is the detailed procedure for it.

 

In AOT Task Macro (\Macros\Task)

 

·         Define Task-ID values, to be used with form Control’s

34080536.jpg

 

Note: To know any task id in AX. Put the debugger in the \Classes\SysSetupFormRun\task and observe the watch window for the value of _p1 (task id)

·         Now place the following code in \Classes\SysSetupFormRun\task before super() call

 

           //Disable Hide/Setup/Go to Main Table Task

            if (_p1 == #taskFilterHide || _p1 == #taskFilterSetup || _p1 == #taskMainTable)

           {

                     Box::info ("@SYS81158", strfmt ("@SYS72189"));

          

                     if (DialogButton::Ok)

                                return 0;

           }

          

           90724390.jpg

 

Now if any of above action is performed then user will end up seeing no access rights Embarrassed.

 

 

Advertisements
Categories: X++ stuffs
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: