A blog about any interesting "Microsoft Dynamics AX" and "Microsoft Dynamics 365 for Finance and Operations" stuff I come across.
Thursday, May 29, 2008
What’s New in Microsoft Dynamics AX 2009
https://mbs.microsoft.com/partnersource/training/news/whatsnewmsdax2009.htm
Requires PartnerSource login.
Wednesday, May 28, 2008
Using the AutoRun parameter to open a form in AX
The command line for AutoRun looks like this:
ax32.exe –StartupCmd=AutoRun_ c:\folder\filename.XML
The XML file holds descriptions of the commands to execute when the client is started.
The following is an example on how you can use this to open the CustTable form immediately after login.
First create the XML fle:
The exitWhenDone tag controls if AX should shut down after completing the tasks listed in the XML file. We don't want that in this case.
I'm saving the file as C:\OpenCustTable.XML.
And then you could create a specfic configuration file to use this start up parameter:
You could of course also just point to this at the command prompt.
That's it...
You can add as many commands as you want to the XML file, so you can really automate a lot of stuff.
The supported commands includes, amongst others:
- Runnning installation, upgrade or configuration check lists
- Loading license information
- Compiling the application
- Syncronize the database
- Importing data
- Importing XPO's
- Running specific elements (like described on the above example)
Search the Administrator Help for "SysAutoRun" to read the included documentation.
Tuesday, May 27, 2008
Change the appearance of printed report ranges
To try this, go to Accounts Receivable / Reports / Base data / Customer.
- Click Select
- Click Print Options
- Check the “Print ranges” check box.
The report header ends up looking something like this example:
Technically this is a fine solution, but it’s not very sexy. So how do you go about changing this section? Take a look at the method \Classes\SysReportRun\buildPrintRanges. This is where AX on the fly builds a new report section with the needed fields and it executes the section to print the requested information.
For a regular no-nonse report like the Customer report, this feature is called from the report template behind the report: \Reports\Report Templates\InternalList\PageHeader:PgHdr_1\Methods\executeSection:
public void executeSection()If you switch the two lines in this method, you will get the ranges printed under the regular page header, which I think is a bit nicer:
{;
SysReportRun::executePrintRangeSection(element);
super();
}

You can add the same lines to your own reports that may not use this template, as long as it is called from the page header section.
With a few lines of additional code in \Classes\SysReportRun\buildPrintRanges you can create cool effects (well, semi-cool):


Transform a date into a number of months from a specific offset date
The algorithm to transform the date into a month is this:
if (columDate < dateEndYr(offSetDate))
{
column = mthOfYr(columDate) - mthOfYr(offSetDate) + 1;
}
else
{
column = 12 - mthOfYr(offSetDate) + mthOfYr(columDate) +1;
}
And here is a job to illustrate the usage:
static void date2Column(Args _args)
{
Date offsetdate;
Date columDate;
int column;
int counter;
;
offSetDate = 30\09\2008;
columDate = offSetDate;
while (counter <= 11)
{
counter++;
// The actual algorithm -->
if (columDate < dateEndYr(offSetDate))
{
column = mthOfYr(columDate) - mthOfYr(offSetDate) + 1;
}
else
{
column = 12 - mthOfYr(offSetDate) + mthOfYr(columDate) +1;
}
// The actual algorithm <--
print strFmt("Date: %1 Month: %2", columDate, column);
columDate = dateMthFwd(columDate, 1);
}
pause;
}
UPDATE: As you can see from the comments to this post, I could have simply used the following built in function:
intvNo(columDate, offsetDate, IntvScale::YearMonth) + 1
Friday, May 23, 2008
AX 2009 RTM
Tuesday, May 13, 2008
Data Migration Tool - Microsoft XAL to Microsoft Dynamics AX
To ease the switch, MS has updated their data migration tool to now support AX 4.0.
The tool can be downloaded from PartnerSource (requires PartnerSource login)
Tuesday, May 6, 2008
Dynamic date ranges in queries
You can use the “d” shortcut as criteria when you enter query selections and the system will convert “d” to the system date when the batch job is executed.
You can also use “d” in ranges:
..d = From date null (1/1/1900) until today
..d, !d = From date null (1/1/1900) until yesterday
I have tested these criteria on 4.0, I’m not sure you can do this with earlier versions. But please let me know if you can.
Changing the keyboard layout for the login of a VPC image
Click here to get a solution on how you change the keyboard layout for the VPC image, so it also affects the login screen.
Thank you Joris, for this great tip.