22 July 2011

Query Range for UTCDateTime Fields

If you need to set a query range for a UTCDateTime field the from and to DateTime value should be set using
SysQuery::range(DateTimeUtil::minValue(), DateTimeUtil::utcNow());
Strfmt is also working, but i prefer SysQuery::range
strfmt('%1..', dateEditDateExpectedDepature.dateTimeValue());

20 April 2011

Convert DateTime String to UTCDateTime

If you need to convert a string containing a DateTime use the following function:
dateTime = str2datetime("24.12.2011 12:01:59", 123);

dateTime = str2datetime( "2011/02/25 23:04:59" ,321 );
dateTime = str2datetime( "Feb-2011-25 11:04:59 pm" ,231 );
dateTime = str2datetime( "2 25 2011 11:04:59 pm" ,123 );
The sequence 123 describes the position of day (1), month (2), year (3). The function DateTimeUtil::any2DateTime() is working different. it is working with dates but its not working with strings:
Date date = 01\05\2012;
;

DateTimeUtil::newDateTime(date,str2time('00:00:00'));

25 February 2011

Strong Name for existing DLL

If you need to add a strong name to an existing Dll start VisualStudio CommandLine and use this commands:
sn -k nameOfKeyfile.snk  <-- to generate a keyfile

ildasm nameOfTheDLL.dll /out:nameOfTheDLL.il <-- Get the MSIL for the DLL

ilasm nameOfTheDLL.il /dll /key=nameOfKeyfile.snk <-- Build a new DLL from the MSIL and the created KeyFile

27 January 2011

Dynamics AX Shortcut Parameters (startup)

If you need an AX Shortcut thats starts a special configuration uses a startup cmd or starts in a different language these parameters will help :)
  • regconfig
  • startupcmd
  • language
A shortcut might than look like this: C:\......\ax32.exe -regconfig=NAMEOFCONFIG -language=de -startupcmd=TWI

To compile the Apllikation on startup use the following command:
 -startUpCmd=compileAll

To generate CIL on startup:
-startupcmd=CompileIL

to compile with cross reference:
-startUpCmd==compileAll_+

11 January 2011

Microsoft previews next generation ERP - Dynamics AX 6

Microsoft has released official details about Dynamics AX 6. Check the following press release for further information: Microsoft Press Release

10 January 2011

Check if Configkey is enabled

To check in code if a configuration key is enabled just call this funktion:
if (isConfigurationkeyEnabled(configurationkeynum(myConfigKey)) == true)
{
  //do something...
}

31 August 2010

Enable Grid Filter for a Form

If you want a form to open with enabled grid filter you can use the following code in the run Method of the form
public void run()
{
    #define.strgG(2855)
    ;
    super();

    //enable Grid Filter
    this.task(#strgG);
}
Therefor the grid should be the selected control. If this isn't the case use the firstField Method of the form:
public void firstField(int _flags=1)
{
    ;
    Grid.setFocus();
}