Monday, June 20, 2011

How to update multiple records in one go - the Fill utility in Dynamics Ax explained

The Fill utility in Dynamics Ax is in my opinion one of the most undervalued features.  Maybe it's because this utility isn't that well known, so I decided to dedicate a blog post to it.

First of all: What is it?
The Fill utility allows a user to update multiple records in one go, setting a specific field with a certain value.  Without the help of a developer, without a lot of manual labour (ctrl+c - next - ctrl+v - next - ctrl+v ...).
Examples: Change the item group for a set of items.  Change the credit limit for a group of customers.

How does it work?
1. Open the form that contains the records you want to update.
2. Select the field you want to change and right-click it.  Select the Record info form in the popup menu.



3.  From the Record info form, select the button that reads 'Fill utility'.
4.  You'll get a query form, asking you for the records that needs updating.



Be carefull to set the right criteria in this stage!
5.  Next Ax show you the records that will be updated, according to the criteria you set earlier.  So again, review with care.
6.  In the last step you set the new value of the field you wanted to change (where it all started.)  Press OK and the change will be performed.  (Believe me, it's easier as it seems from the explanation above.)

Some notes:
Is the Fill utility not available?  You cannot find it?
This feature is controlled by a configuration key.  So make sure the administrator enables the configuration key, under Administration - Setup - System - Configuration.  The configuration key for the Fill utility is right under the first header, Administration.

There is also security key involved.  So if a users complains he/she doesn't see the Fill utility button in the record info screen, make sure this user is member of a group with the appropriate user rights.

What have you done?!
If you were a bit too quick pressing next/ok, you can always see afterwards what was changed.  Dynamics Ax keeps a log of updates performed by the Fill utility.  You can find this log under Basic - Inquiries - Fill utility Log.


Which fields are avaible for using the Fill utility?
Or maybe, which are not available.  Not available for use by the fill utility are the fields recid and dataareaid.  Also if the field you select is the primary key of the table (like the itemid in InventTable, accountnum in CustTable), you cannot use the Fill utility.
If the field you select is not a field of the underlying table but a datamethod instead, again you cannot use the fill utility.

Thursday, June 16, 2011

What are the tables InventSumDateTable and InventSumDateTrans used for?

When browsing the AOT, you may come across these two tables: InventSumDateTable and InventSumDateTrans.

Using your table browser, you see that they are empty.  So what are they used for?

Both tables are used by the report Physical inventory by inventory dimension, which can be found under Inventory Management - Reports - Status - Physical inventory
This report takes you back in time, calculating the stock on hand of your items for any given date in the past. 
You might experience some performance isssues when running this report, as some calculations are needed.

The report uses both tables mentioned earlier, to store these calculations.  After generating the report, a cleanup is performed.  So if you should stumble on some left over data in these tables (the user wasn't patient enough and aborted), you can safely delete any data left in these tables.

Tuesday, June 14, 2011

What happens if you go beyond the license expiry date in Ax?

If you have an expiry date on your license of Ax or if you are using a demo license key of Ax, at some point in time the license will become invalid.
What happens is that Dynamics Ax will start to run in demonstration mode. 
Yes, you can keep using the system.  The AOS will not stop.  But....   you are faced with some limitations in the system.

  • The AOT is no longer available for editing, so no more custom coding.
  • There is a maximum of 2 concurrent users.  If more users try to log on, you can get following error message:

  • You cannot enter a date in a datefield on a form, that is beyond the license expiry date.
So all in all you can use Dynamics Ax as your online archive, but no longer for your daily operations.

Sunday, June 12, 2011

How to copy a company account in Ax

When you are using Dynamics Ax, you probably have more than one instance running besides your Live Production system.  Maybe you have some development environments, or test environments.  But even then it can be useful to have a copy of a company, within your Live Production environment.  You can use it for testing purposes or for starting up a new company, with similar settings as the current one.
Microsoft made it actually quite easy to duplicate a company account within Ax, it's almost by clicking a single button.

Step-by-step guide:

Go to Administration - Common forms - Company accounts.




Select the company account you want to use as template, your source to copy from.  Then click Duplicate.
Wait a sec, Ax is investigating the company account.


Next, enter a new company account id, followed by a company name.  (Ax will create this new company account for you, you don't have to manual create one.)
Click OK and you're off.  Depending on the size of your source company account, this can take some time (think of hours).  Not only your master data is duplicated (customers, items), but also all the transactions from the source company account (like inventory transactions, ledger transactions).
You might wanna perform this duplicating outside of office hours and using a batch server for this is also a good idea.

Also note:
The guide above works for Ax 2009, but it won't work in Ax 2012.  In Ax 2012, this function is no longer available, it got deprecated.  Reason, from the official MS documentation: The organization model represents a paradigm shift in Microsoft Dynamics Ax 2012.
In short: You must rely on import and export again in the future.

Wednesday, April 13, 2011

What is the release data of Dynamics Ax 2012?

With Convergence 2011 taking place in Atlanta (US) right now, we see a peak in all the buzz on the web about MS Dynamics Ax 2012, the next major release of Ax.  Microsoft is releasing bits and pieces of information regarding new functionality, technical enhancements and so on.  And they have communicated on the release date as well, giving a new estimate.  As it was previously stated that general availability would be "Q3 2011", everyone expected this to be "September 2011".  But positive surprise:

   MS Dynamics Ax 2012 will be available in August 2011.

(Features and date come with a MS disclaimer, so all tentative right now.)

Tuesday, April 5, 2011

How to format your number the CLR style

Converting (real) numbers to a string representation is a common requirement. There are different roads that lead to Rome, I'll show you some alternatives, which all have one thing in common: They all use Format.

You can use num2str to convert your real numbers to a string, or you can use Format.
Example, controlling the number of decimals showed:  (decimal point acts as decimal separator)

static void FormatExamples(Args _args)
{
    real        mynumber=123.4;
    String30    mynumberstr = System.String::Format("{0,0:#.00}", mynumber);
    ;
    info(strfmt("Your number is %1", mynumberstr));
}

You can use the Format command to add leading zeros also.
Example:

static void FormatExamples(Args _args)
{
    real        mynumber=123;
    String30    mynumberstr = System.String::Format("{0,0:00000}", mynumber);
    ;
    info(strfmt("Your number is %1", mynumberstr));
}

Notice that you can also use rounding like this as well.  Besides this basic function, we can actually do some conversions.
You can use Format to convert to hexadecimal for example.
Example:

static void FormatExamples(Args _args)
{
    int        mynumber=255;
    String30   mynumberstr = System.String::Format("{0,0:X}", mynumber);
    ;
    info(strfmt("Your number in Hex: %1", mynumberstr));
}

Monday, April 4, 2011

A hidden feature of the output window

If you are an Ax developer then you've probably used the Print command in Dynamics Ax, either to do some debugging or during testing of code.  The print command allows you to print some results or some values to screen.  Optionally enter a pause statement at the end, in order to be able to read the actual output.

Example:

static void WindowDemo(Args _args)
{
    print('Hello world');
    pause;
}

Sort of a hidden feature in Ax, is that you can actually control the output window, both size and position.  You can use the Window command for that.

Example:

static void WindowDemo(Args _args)
{
    window 120,60 at 5,5;
    print('Hello world');
    pause;
}
With the Window command in following format

   window deltax, deltay at x,y

x   Top left position of the window, x-coördinate (Horizontal)
y   Top left position of the window, y-coördinate (Vertical)
deltax   Width of the window, in characters
deltay   Height of the window, in lines of text