Using FilePath on a form

  • June 25, 2009
  • 1 Comment

When you want a filebrowser on your form and you only added a field that extends from the Extended Data Type FilePath, you wil get a stack-trace/error message when you click on the folder icon. Don’t panic, there is nothing wrong with your AX. Like the error explains you just need to provide the form … Continue Reading

Crap

  • June 16, 2009
  • 1 Comment

Did you ever find any ‘personal’ comments from a Microsoft developer in AX code? I did. In AX2009 SP1 I found the following code block in the method displayComments() on the form HRMGoal: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 … Continue Reading

Working with numbersequences – new NumberSequence

  • May 5, 2009
  • 1 Comment

When you want to create a new NumberSequence in AX you have to do the following steps: 1. Create a new Extended Data Type (EDT). Often this EDT extends from num. (this step is not mandatory, but it is a best practice) 2. Discide in witch module this new Number Sequence Reference (classes NumberSeqReference_…) should … Continue Reading

Use of DateTime in select statement

  • April 26, 2009
  • 0 Comments

Created/ModifiedDateTime is a datetime field and the value will be stored as UTCDateTime. So when you want to find all the records created/modified on a certain date, you have to find all the records between the start of the day and the end of the day. The newDateTime() function is defined in the DateTimeUtil class … Continue Reading

Customizing EditorScripts

  • April 23, 2009
  • 0 Comments

Ax had a few interesting scripts for the developer. When you have an idea for a new useful script you can extend the the EditorScripts Class (ClassesEditorScripts) with your new class. Here is a example where you automate some custom comment while developing: 1 2 3 4 5 6 7 void comments_MyComment(Editor e) { e.unmark(); … Continue Reading

Select Table/Field/User/… (PickList)

  • April 20, 2009
  • 0 Comments

Sometimes you want your user to select a sertain table/field/… When you want to program this selection all by yourself you have to make a table, override the lookup()-method, … There is also a easy way to do this. You can use the pic**** methodes in the Global class: How do you use these classes … Continue Reading

Type of Anytpe enum

  • April 14, 2009
  • 0 Comments

Normaly you try to avoid using AnyType variables, but sometimes you are forced to use them. When you use a AnyType enum and you want to cast it to it’s actual data type, be sure you cast it to the right type to prevent stack-traces. You can get the enumId from a AnyType-enum by using … Continue Reading

Hide/destroy annoying Content Pane in AX2009

  • April 14, 2009
  • 2 Comments

Here is a small job, which hides content pane in Dynamics Ax 2009. This content pane can be useful for users, but as a developer it can be very annoying. 1 2 3 4 5 6 7 8 9 10 11 12 static void hideAnnoyingContentPane(Args _args) { HWND contentPane = WinApi::findWindowEx( WinAPI::findWindowEx(infolog.hWnd(), 0, ‘MDIClient’, ”), … Continue Reading

Class RunBaseReport

  • April 13, 2009
  • 2 Comments

When you create a class that extends from RunBaseReport and you try to modify the printer preferences it won’t have any effect. This small bug can be fixed very easy. Edit the class RunBaseReportDialog, method main and check lines 14 and 15: 1 2 3 4 5 6 7 8 9 10 11 12 13 … Continue Reading

Fix unbalanced TTS

  • April 13, 2009
  • 2 Comments

During development you may see one of these errors: They are pritty anoying because set your Ax session in an unusable state that you can’t close properly. Normally you have to kill the ax32.exe in the Task Manager. Instead, open the AOT and run this job: 1 2 3 4 5 static void resetTTS(Args _args) … Continue Reading