Friday, January 30, 2009

Channel 9 video: Dynamics AX Version Control interview from Convergence in Copenhagen 2008

20 minutes interview about version control in AX 2009 with Michael Fruergaard Pontoppidan (Principal SDE) and Morten Jensen (Program Manager) from the Dynamics AX team in Vedbaek, Denmark.

Thursday, January 22, 2009

Adding simple display fields on VS reports

One thing I feel is missing from the documentation for AX Visual Studio reports is a simple explanation or demo of how to create an old school display field in a report.

I could figure out that a DataMethod was needed but it took me some time to figure out how connect the method with a field on the report and how to pass parameters to the DataMethod.

You add a datamethod like this:
[DataMethod(), AxSessionPermission(SecurityAction.Assert]
public static string DataMethod1(string itemId)
string demoString = '(' + itemId + ')';

return demoString;

Then add a field to your design, and in the Expression editor for the field add the code to call your datamethod:


Tuesday, January 6, 2009

Shortcut to the query object of a form data source

Did you now that to get the query object of a datasource, you can write dataSource_q instead of dataSource_ds.query()

For example in the CustTable form you can write:
query = custTable_q;

Instead of:
query = custTable_ds.query();

Monday, January 5, 2009

Bug in EP 2009 when having the debug flag set to true

When you use lookups that are built as user controls, you can get an error like the following error when you cancel the lookup:

A Runtime Error has occured
Line: 198
Error: Sys.ArgumentNull
Exception: Value cannot be null.
Parameter name: panelsDeleting[10]

Here are repro steps to see the bug in Shop Floor Control, which currently seems to be the only place having lookups built as user controls:
  1. Open EP for an employee setup for SFC
  2. Go to Shop Floor Control (This puts you in the Electronic timecard)
  3. Click the "Lock" button
  4. Click "Add lines"
  5. Open the lookup for Reference
  6. Close the lookup without selecting anything, by clicking the webpage somewhere not in the lookup
  7. Try to use any other lookup or move to another record in the grid, if you have more than one line in the grid
The bug is related to a bug in AJAX when it runs in debug mode. If you have debug="true" in the web.config file, change it to debug="false".