Sunday, January 30, 2011

Restoring AX Database From One Environment to Another


When you restore a database from a production environment to a test / dev environment, you should run these scripts to ensure that your database is synchronized with the Application environment and proper object server.
Here are some samples scripts you should run:
Select * from BatchServerGroup
–Update BatchServerGroup set SERVERID = ’01@NewAOS’ where SERVERID = ’02@OldAOS’
Select * from BATCHSERVERCONFIG
–Update BATCHSERVERCONFIG set SERVERID = ’01@NewAOS’ where SERVERID = ’02@OldAOS’
Select * from SYSCLUSTERCONFIG
select * from SYSSERVERCONFIG
–Update SYSSERVERCONFIG set SERVERID = ’01@NewAOS’ where SERVERID = ’02@OldAOS’
Select * from SYSSERVERSESSIONS
–Update SYSSERVERSESSIONS Set AOSID = ’01@NewAOS’, Instance_Name = ’01′ where AOSID = ’02@OldAOS’
Select * from Batch
–Update BATCH set SERVERID = ’01@NewAOS’ where SERVERID = ’02@OldAOS’
select * from SYSCLIENTSESSIONS
–delete SYSCLIENTSESSIONS
Beside these, you should also check the Dynamics database for Enterprise Portal, Analytical Server BI setup and reporting server configuration. This could be done through SQL Server access or trough AX Administration setup.

Backup and restore Dynamics AX application files - made easy


Here is sample code which can be used to automatically copy Dynamics AX application files to an archive. This step is really important if you want to ensure that you safely backup your Application files.
To restore your application, you should copy the application files from the backup to the proper application directory and then start service and compile all objects in the application.
This is the sample batch file which you can run using Task scheduler or any other similar program.
@echo on
for /f “tokens=1,2,3,4* delims=.:/- ” %%i in (‘date /t’) do (
for /f “skip=1 tokens=1-4 delims=/-,().” %%x in (‘echo.^|date’) do (
set weekday=%%i&set month=%%j&set day=%%k&set year=%%l))
REM stop aos service
net stop “Dynamics AX Object Server 5.0$01-XXXXX”
REM maps to folder where backups are stored
net use z: /d /y
net use z: \\Backup
REM creates folder with day and time stamp
z:
cd \
mkdir %weekday%%month%%day%%year%
REM copies app folder to the backup location
XCOPY “c:\Program Files\Microsoft Dynamics AX\50\Application\Appl*.*” z:\%weekday%%month%%day%%year%\app\ /K /O /Y /F /I /E
REM start aos service
net start “Dynamics AX Object Server 5.0$01-XXXXXX”
You should replace the “Dynamics AX Object Server 5.0$01-XXXXX” with your service name.

Tuesday, January 11, 2011

Official Details about Dynamics AX '6' released

2Here we are, kicking off 2011 with a bang for Microsoft Dynamics AX! Next week in the Microsoft Dynamics AX 2011 Technical Conference, in which the primary focus in on Microsoft Dynamics AX '6'.


To kick things off, Microsoft today did a press release, in which official details about the Microsoft Dynamics AX '6' product was released. A direct link to the Press Release can be found here.: Microsoft Previews Next-Generation ERP

This press release was well covered by both MSDynamicsWorld.com, here: Microsoft Confirms Details of Upcoming Dynamics AX "6" Version, as well as MaryJo Over at ZDNet, on her 'All About Microsoft' blog, found here.: 2011 to be a big year for Microsoft in ERP

Tuesday, January 4, 2011

Secrets of SysLastValue

SysLastValue is a kernel-level table that does not show up in the AOT data dictionary. There is however a form called "Usage Data" that can be accessed (check tools / development tools / application objects / usage data). The form itself is called "SysLastValue" (yeah, really) in the AOT. We can use the datasource on the form to right/click and table browse this mysterious table.

SysLastValue stores many different things. The majority of records you will find in there pertain to caching, or "last use" type of data, which will remember the last values you've entered on a dialog, the last printer selection you made for a report, etc. But, which is why we're interested, it will also store any user setup you make on a form, and any and all queries being stored. The field "recordtype" will indicate exactly the type of values stored.

We are interested in type "UserSetup" with the "isKernel" flag set to no, these are the user setups on forms, and the "elementName" field will tell you what form name.
Type "UserSetupQuery" contains the queries saved for a form. You will notice the "designname" contains the form's name, and the "elementname" field contains "f:formname".

Happy new year 2011 - the year of MS Dynamics AX 2011 ERP

Happy new year.

Bye bye AX 2009, now its a time for AX 2011/AX 6.0