September 08, 2012

Security Keys in Ax

Security Keys in Ax

Dynamics Ax provides following keys to provide the security for your application

1.License Keys :

It is the First Level Security , specifies what all featues/modules/developemnt tools we can access in the standard product. License Keys will be used after installation to unlock the product. License Keys will be issued by the microsoft for partners/vendors to develop vertical/generic solutions.


2.Configuration Keys :

It is Second Level Security , To Enable/Disable the object/feature for all the users.


3.Security Keys :

These keys used for enable/disable any object/features to group of users.


4. Record Level security :

Basically it deals with the data , if you want to restrict the viewing of records per user group than we setup record level security.

-Harry

September 06, 2012

How to Enable X++ debugging for Dynamics Ax 4.0 Enterprise Portal

How to Enable X++ debugging For Enterprise Portal

To enable X++ debugging in the current user session in Microsoft Dynamics AX 4.0, follow these steps:

1. On the server that is running Internet Information Services (IIS), open a console session (also known as session 0). To use Terminal Server to do this, click Start, click Run, type mstsc /console in the Open box, and then click OK. Then, start Microsoft Dynamics AX 4.0 in the Terminal Server session.

2. Set the .NET Business Connector configuration and the client configuration to enable breakpoints when you run the Business Connector. To do this, follow these steps:

 a. Click Start, click Run, type Control admintools, and then click OK.
 b. Double-click Microsoft Dynamics AX Configuration Utility.
 c. In the Configuration target list, click Business Connector (Non-interactive use only).
 d. On the Developer tab, click to select the Enable user breakpoints to debug code running in the business      connector check box and the Enable global breakpoints to debug code running in the business connector check box.
 e. Click Apply. Then, click OK.Repeat step a through step e for the local client configuration in the Configuration target list.

3.Enable debug mode. To do this, follow these steps:

 a.On the Tools menu, click Options.
 b.Click the Development tab.
 c. In the Debug mode box, click When Breakpoint.
 d. Click Apply, and then close the Options dialog box.

4.Locate the code that you want to debug. Before the code that you want to debug, type the keyword breakpoint.

5.Manually start the debugger. To do this, click Tools, point to Development tools, and then click Debugger.

6.Enable desktop interaction for the World Wide Web Publishing Service. To do this, follow these steps:
 a. Click Start, point to All Programs, point to Administrative Tools, and then click Services.
 b. Right-click World Wide Web Publishing Service, and then click Properties.
 c. Click the Log On tab.
 d. Click to select the Allow service to interact with desktop check box.
 e. Click OK to close the World Wide Web Publishing Service (Local Service) dialog box.

7. Make sure that the user who is logged on to the computer is one of the following users:

•The user who is running the Web application pool
•The user who starts a session in Microsoft Dynamics AX 4.0
•The user who set up breakpoints in Microsoft Dynamics AX 4.0


-Harry

August 28, 2012

How to find total records in any Table

Hi Friends,

If you want  to know the total exist records in any AX table, just follow the following steps:-

Step 1:- Go to Menu-> Tools-> Development Tools-> Number of records

Number of records 1
Step II-
when you select this, the following window will open

Number of records 2
Step – III-
Enter the table name in “Name” Field
for eg. PurchTable, salesTable etc.
Here you find all exist records in selected table with different companies.
- Harry

August 08, 2012

Limiting user sessions(Set Timeout For User Session)

Limiting user sessions

Our company has a limited number of AX user licenses, as most companies will. Some people like to open multiple sessions (and eat up licenses) while they're working. We wanted some way for the system to prevent this from happening.
To achieve this I created a table called UserSessionLimits. It has a field called UserID (extended data type is userId) and this is a mandatory field. It has another field called MaxSessions (this is an integer) and it also is mandatory. The index is UserIDx, it contains userid and it is unique.
The code that accesses this table is written so that if a user is not in this table, then they are limited to one session, so add users to this table if they are exceptions and you want them to be able to have more than one session open.
Add code to the "Info" class, in the startup() method. The Info class can only be accessed by going to the System Documentation area of the AOT.
In the startup method, at the top, I placed this code:

select count(recid) from sysClientSessions
where sysClientSessions.userId == curuserid() &&
sysClientSessions.Status == 1 &&
sysClientSessions.clientType == 0;
if(sysClientSessions.RecId > UserSessionLimits::getMaxSessions(curUserid()))
{
box::stop(strfmt("You have exceeded your session limit of %1, the application will now close",
UserSessionLimits::GetMaxSessions(curUserid())));
appl.globalcache().set(classstr(info),identifierStr(AutoLogoff), true);
this.shutDown(true);
}

By searching only for clientType = 0, you will only be looking for "User" sessions. Web sessions or worker sessions (batches that are running) will not be affected.
There have been times that people have gotten around this. They quickly opened two sessions immediately one after the other. If they are simultaneously opened, it's hard to catch. Also, sometimes this locks people out. If they were doing something and AX shut down on them or their system froze, sometimes it takes some time for the session to end for them to get back in again. Your network administrator can control when inactive sessions time out.

We also set automatic shutdown (in user options) to 60 minutes. So if their session is inactive for 60 minutes, it will close.

See also,