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,


Update multiple records with 'Fill Utility'

Update multiple records with 'Fill Utility'

Note:- FOLLOW THIS STEPS ON YOUR OWN RISK,I WILL NOT BE RESPONSIBLE FOR ANY GOOF UPS. SO PLZ BE CAREFULL DURING THESE STEPS.
The Fill utility enables authorized users and/or administrators to mass-update records, similar to the find and replace functionality. We can use an alternative method also to Update Multiple records in Grid.
this utility assists administrators or users during implementations/Development or when business process changes affect multiple records.
Cautions:
1> It is recommended practice to take backup of entire database before performing this 'Fill Utility' operation.
2> It is recommended to use this feature during implementations/Development (or) when business process changes affect multiple records.
3> Please follow the standard procedure to enable this configuration. This may require restart of AOS & Data dictionary sync to make sure changes take immediate effect.
4> Be aware that changing numerous records at the same time can be time-consuming.
Enable configuration key:
Path: Dynamics Ax > Administration > Setup > System > Configuration > Under Administration tree (Enable 'Fill Utility' option)
Fill Utility usage:
Open the form that contains the field to update.
Example:  Dynamics Ax > Accounts Receivable > Common forms > Customer details > Select required customer record > payment tab

Right click on the field 'Ledger account' field > Record info

Click button 'Fill Utility'

We can select the criteria here
Click button 'OK'

Validate the records and click 'OK'

Select new 'Terms of payment' = N045 (here we have to specify new terms of payment)
Click 'OK'
Caution: Be aware that changing numerous records at the same time can be time-consuming.
Fill Utility log:
Path: Dynamics Ax > Basic > Inquiries > Fill Utility log

Security key: Adminfillutility
This completes 'Fill Utility' feature details from usage.
This a very useful to update multiple records at the same time.
- Harry