Dynamics AX 2012 now supports included columns on the indexes. While this is a great feature, there is a bug when there are indexes in system which has any of the included columns. The bug causes these indexes to be recreated in a full database synchronization even if no change is made to them. If these indexes exist on one of the larger tables, system takes a lot of time just to do a synchronization . Luckily a hot fix has been issued and can be obtained from customer source/partner source.
This posting is provided "AS IS" with no warranties. Use code at your own risk.
Friday, 22 June 2012
Friday, 15 June 2012
Attaching Ax32Server.exe process to Visual Studio
Last week I needed to debug a batch job. In AX2012 all the batch jobs run in IL. To debug these jobs you need to use Visual Studio and attach the AOS process. When I tried to attach Ax32Serve.exe, the process was disabled in the window as show below
This posting is provided "AS IS" with no warranties. Use code at your own risk.
| Attach to process window |
This made me wonder what is stopping the process from being available to attach. After a little investigation I realized that we are using Debug Diagnostic tool to create the dumps in case the AOS crashes and one of the crash rules to monitor the AOS was active. After de-activating the rule the AOS process was available to be attached for debugging purpose. So apparently only one application can monitor a running process.
This posting is provided "AS IS" with no warranties. Use code at your own risk.
Labels:
AX2012,
Debugging,
Dynamics AX,
VS2010
Wednesday, 13 June 2012
Wrong EDT on HcmEmployment
In Dynamics AX 2012, financial dimensions has been given a full makeover. As a results the tables which had fields with EDT Dimension has to be replaced with fields that have the new EDT DimensionDefaut. This can be observed by looking at fields like CustTable.DefaultDimension. However HcmEmployment.DefaultDimension refers to EDT RefRecId as shown below.
The method addDataSourceToQuery in the DimensionProvider class checks the field's EDT and throws error if it is not a proper EDT. This field in the HcmEmployment table needs to be changed to the right EDT until a hotfix addresses the issue.
This posting is provided "AS IS" with no warranties. Use code at your own risk.
Although it works fine as DimensionDefault is derived from RefRecId, but if you try to use some of the classes like DimensionProvider, system will throw following error
Unknown type: RefRecId
The method addDataSourceToQuery in the DimensionProvider class checks the field's EDT and throws error if it is not a proper EDT. This field in the HcmEmployment table needs to be changed to the right EDT until a hotfix addresses the issue.
This posting is provided "AS IS" with no warranties. Use code at your own risk.
Labels:
AX2012,
Dimensions,
Dynamics AX
Monday, 18 December 2006
Attaching new database to AOS in Dynamicx AX 4 SP1
We are in the process of upgrading our Dynamics AX application from 3.0 to 4.o. After the upgradation of Application, last week we started the database upgradation in Dev environment. We are using SQL 2000 as our DB for the 3.0 application and we have decided to upgrade to SQL 2005 along with this Dynamics application. So after ruinning the upgrade script in Dynamics AX 3.0 we created a db in SQL 2005 and ran the DB migration application. This went well and when we startetd the AOS after this process, it failed to start and gave following error.
"Object Server 01: Internal Error occurred executing stored procedure when creating session for the AOS. "
After a little investigation we found out that there are two stored procedures(createserversessions, createusersessions) missing from the database that we have created. These are not missing when we use Dynamics AX setup to create the database. So if you are not using the setup to do everthing for you, you have to be prepared to do some stuff yourself. I'm adding some steps here that I went through when I tried to do stuff myself.
In Dynamics AX 4.0 SP1 installation setup, you are asked to enter the account under which want to run the AOS service(not present in Dynamics AX 4.0 installer, so you have to change the account in services to run it properly otherwise you'll receive an error that can be viewed in event viewer).
Once you choose that account in the installer, the installer adds this account in the DB Logins and gives it following access to you DB.
- db_datareader
- db_datawriter
- db_ddladmin
- public
if you change your database after the AOS is installed you have to give the user under which AOS is running the above mentioned rights to your database, and create the procedures (createserversessions, createusersessions). These procedures can be copied from the database that was created by the installer. After you create these procedures give the user, under which AOS is running, Execute permission on these procedures and the AOS should start without any error.
This posting is provided "AS IS" with no warranties. Use code at your own risk.
"Object Server 01: Internal Error occurred executing stored procedure when creating session for the AOS. "
After a little investigation we found out that there are two stored procedures(createserversessions, createusersessions) missing from the database that we have created. These are not missing when we use Dynamics AX setup to create the database. So if you are not using the setup to do everthing for you, you have to be prepared to do some stuff yourself. I'm adding some steps here that I went through when I tried to do stuff myself.
In Dynamics AX 4.0 SP1 installation setup, you are asked to enter the account under which want to run the AOS service(not present in Dynamics AX 4.0 installer, so you have to change the account in services to run it properly otherwise you'll receive an error that can be viewed in event viewer).
Once you choose that account in the installer, the installer adds this account in the DB Logins and gives it following access to you DB.
- db_datareader
- db_datawriter
- db_ddladmin
- public
if you change your database after the AOS is installed you have to give the user under which AOS is running the above mentioned rights to your database, and create the procedures (createserversessions, createusersessions). These procedures can be copied from the database that was created by the installer. After you create these procedures give the user, under which AOS is running, Execute permission on these procedures and the AOS should start without any error.
This posting is provided "AS IS" with no warranties. Use code at your own risk.
Labels:
Dynamics AX
Wednesday, 13 December 2006
How to prevent user from using Hide/Setup features in Right-Click Menu on a form
Last week while we were fine tuning user right in Dynamics AX 3.0 ( a long overdue work), I came across a intresting scenario at a very crucial time. One of the user called me and told me that she dont have access to a specific field. I thought that maybe I forgot to give access to that user group. When I checked the group permissions the access was there. So I coudnt find out why the user dont have access to that field. I was seriously confused. As a last resort to the problem I gave the user Administrator right(a dangerous thing, if user is careless) and still that field was disabled. Then I asked user to get out of her seat and let me see the system in more detail and then I found out that the field she meant was actually hidden by her and thanks to IntelliMorph, the position of that field was taken up by another field (which was read-only). So showing that field solved the problem. This was really frustrating, so we decided to remove Hide and Setup from right click on any from(althought its very silly to think like this, as this is the beauty of IntelliMorph that users can customise interface the way they want to see it, but sometimes we do need to disable it especially when user themselves dont learn how to solve such small issues).
As I started to find out how to remove Hide and Setup from right click. I came to know that these are somewhere in base classes that are not accessable in Axapta. Setup however can be controlled by assigning Security Keys to "SysSetupForm" and then using the security framework to restrict access to this setup form. But I can't find any way to do the same with the Hide functionality. With a little more research I came accross "SysSetupFormRun" class. This class has a very intresting method called "task". Here we can tap into the task that are available from the right-click in a form and do whatever we like with it.
After looking at the task method in SysSetupFormRun, I found out that there is a "Task" macro that hold all the enum for different tasks. So I modified these two piece of code and was able to stop users from using Hide and Setup. Following is the code that I modified.
In AOT->Macros->Task add the following code
This will still show Hide and Setup tasks in right-click menu on a form but nothing will happen as the user clicks on it(not the proper way but it solves the problem).
Note: This will disable these tasks for all users, you can code it to be available for a user group and not available for others.
This posting is provided "AS IS" with no warranties. Use code at your own risk.
As I started to find out how to remove Hide and Setup from right click. I came to know that these are somewhere in base classes that are not accessable in Axapta. Setup however can be controlled by assigning Security Keys to "SysSetupForm" and then using the security framework to restrict access to this setup form. But I can't find any way to do the same with the Hide functionality. With a little more research I came accross "SysSetupFormRun" class. This class has a very intresting method called "task". Here we can tap into the task that are available from the right-click in a form and do whatever we like with it.
After looking at the task method in SysSetupFormRun, I found out that there is a "Task" macro that hold all the enum for different tasks. So I modified these two piece of code and was able to stop users from using Hide and Setup. Following is the code that I modified.
In AOT->Macros->Task add the following code
#define.taskFilterSetup(2847)
#define.taskFilterHide(2848)
In AOT->Classes->SysSetupFormRun->task add the following code public int task(int _p1)
{
#task
FormDataSource formDataSource;
int ret;
if (_p1 == #taskFilter)
{
formDataSource = this.objectSet();
if (formDataSource &&
formDataSource.queryRun() &&
formDataSource.queryRun().args() &&
!formDataSource.queryRun().args().caller())
{
formDataSource.queryRun().args().caller(this);
}
}
// code change begin
if (_p1 == #taskFilterHide or _p1 == #taskFilterSetup)
{
return 0;
}
// code change end
ret = super(_p1);
return ret;
}
This will still show Hide and Setup tasks in right-click menu on a form but nothing will happen as the user clicks on it(not the proper way but it solves the problem).
Note: This will disable these tasks for all users, you can code it to be available for a user group and not available for others.
This posting is provided "AS IS" with no warranties. Use code at your own risk.
Labels:
Dynamics AX
Subscribe to:
Comments (Atom)