Monday, January 23, 2012

Best practices: Autogrowth of the database, what not to forget

Some system administrators are happy already when Dynamics Ax is fully installed and up-and-running.  But there is more.  Ask yourself: Is everything set at its best?  Did you do everything to ensure stability in the future as well?
An often overlooked setting here is the growth of your Ax SQL database, a forgotten setup which may come back to haunt you later as a performance issue.

When creating a database in MS SQL server, you receive the default database settings.  For autogrowth settings, these include an autogrowth setting of 1 Mb.

There are 2 major reasons on why you want to review this setting:

  • Letting the database grow with small portions gives an almost constant extra overhead for your transactions, slowing you down.
  • Physical fragmentation can have a severe effect on the overall performance of your database.

So what should you do then?  What's the best practice here?

Don't rely on the autogrowth parameters.  Size your database, based on the expectations.  Like expected transactions for sales, ledger accounts, production etc.  That may mean to set an initial size big enough to start working and an evaluation after 1 or 3 months.  To be repeated each half year for instance.  So the set file size would cover the requirements, without the need to grow automatically.

You may leave the autogrow on, no problem.  But it should be considered merely part of a contingency plan for unexpected growth.  Set an autogrowth rate of for example 200 or 500 Mb.
Be sure to check on your database size from time to time.  Or even better, setup some proper monitoring right from the start.  Being proactive is key here.  It's always better to do your SQL maintenance (=resizing of the database) in non-peak hours.

For those not knowing where to look for or how change these settings:

From the Microsoft SQL Server Management Studio, select the database in question.
Right click the database and choose Properties. Under Files, you find the database file information, including the Autogrowth settings.




Note: You might wanna check the Auto Shrink feature as well, make sure it's switched off.

Wednesday, January 4, 2012

Different ways of getting the current date: Which one should you pick?

There are a number of ways in Dynamics Ax to get the current date.
Maybe you've tried some of them, and most likely they all returned the same result.  Albeit that's actually depending on your installation and setup.

What's the difference?  Which method should you use when writing code to get the current date?
A short overview:

today

The today function uses the date of the machine.
This method is deprecated, for the simple reason that there's no support for different time zones.


systemDateGet

This function returns the session date.  If there is no specific session date set, it will return the system date.
Remember what the session date is?
It's a feature which allows you to change the date used within your specific Ax session, fe to back-date transactions.  Changing the posting date (all modules), changing the invoice date (and subsequent due date).  Note that for system fields of a table like CreatedDateTime and ModifiedDateTime, the computer date is used and not the Ax system date.

You can set the session date under Tools - Session:



DateTimeUtil::getSystemDateTime

This method gets you the session date as well, if not specified the system date.
The method returns a utcdatetime value.  You can use DateTimeUtil::Date to extract the date part.
Only DateTimeUtil::getSystemDateTime compensates for the time zone of the user.
Remember there can be a difference in date and time between server and client.
From application point of view, when establishing business logic, this method is the natural choice.

This last method is considered best practice in Ax.

In code, the different options:

static void WhatsTheDate(Args _args)
{  ;
   info(date2str(today(),123,2,2,2,2,4));
   info(date2str(systemdateget(),123,2,2,2,2,4));
   info(date2str(DateTimeUtil::date(DateTimeUtil::getSystemDateTime()),123,2,2,2,2,4));
   info(date2str(DateTimeUtil::date(DateTimeUtil::applyTimeZoneOffset(DateTimeUtil::getSystemDateTime(), DateTimeUtil::getUserPreferredTimeZone())),123,2,2,2,2,4));
}


Conclusion: Use DateTimeUtil::getSystemDateTime, unless you have very good reasons not to.

In a following blog post, I'll dive deeper into the functions available with DateTimeUtil, with different timezone support and user-related timezone settings.

Saturday, December 31, 2011

DateSeparator: What's missing in the documentation of date2Str

The function date2Str provides a good way to convert a date to a string in Dynamics Ax.
The string output can be controlled, you can specify the notation with different parameters.
It goes something like this:

   str date2Str(
    date date,
    int sequence,
    int day,
    int separator1,
    int month,
    int separator2,
    int year
    [, int flags = DateFlags::None])


In an example:

static void Example_date2str(Args _args)
{   ;
    info(date2str(systemdateget(),123,2,1,2,1,4));
}


But the documentation lacks a bit of details around the different separators to use.



The different options are all listed here, but the actual values to use in the date2Str function are omitted.  The function requires an integer (or enum) as parameter for the date separator.
And not a char or string, like "/" or "-".
You can use the enum DateSeparator for this.  This enum has following enumerations:

NameValueDescription
Auto99Auto
None0None
Space1
Dot2.
Hyphen3-
Slash4/

This part of the documentation got updated with the newly released Ax 2012 version.  So the missing info only applies to versions 3.0, 4.0 and 2009.  (Like you can find both in Ax help system - see screendump above- or online at MSDN over here.)
Same example as above, but less cryptic:

static void Example_date2str(Args _args)
{   ;
    info(date2str(systemdateget(),
        123,
        dateDay::Digits2,
        DateSeparator::Space,
        DateMonth::Digits2,
        DateSeparator::Space,
        DateYear::Digits4));
}

Good to note here as well is that there is another way of setting the notation: Use the regional settings of the user.
For that, just set all the formatting parameters to -1.

Like this:

static void Example_date2str(Args _args)
{   ;
    info(date2str(systemdateget(),-1,-1,-1,-1,-1,-1));
}

Dynamics Ax actually has a predefined function for this in the Global class, being date2StrUsr.
static void Example_date2str(Args _args)
{   ;
    info(date2strUsr(systemdateget()));
}

This function depends on date2Str, just like in the example above.  From the Ax source code:
static TempStr date2StrUsr(date transDate,int flags = DateFlags::None)
{
    return date2str(transDate,-1,-1,-1,-1,-1,-1,flags);
}

Monday, December 26, 2011

Happy New Year!

Thanx for reading my blog, now and in the future.  Wishing you all the best for 2012.

Best wishes for 2012
A big thank you for the nice comments as well!

Dynamics Ax and the cloud - Part 2

In the last blog post we talked about Dynamics Ax and the cloud.  And the fact that Microsoft's latest release of Dynamics Ax, Ax 2012, is not the cloud version (some hoped for).  Is it a sign?  Should we be unhappy about that?



Microsoft already has some cloud solutions up and running, focussed on business users.  With Office 365, CRM 2011 for example.   With  varying degrees of success, on all levels.
Take availibility for example: Customers of Microsoft’s Business Productivity Online Services (BPOS), with hosted Exchange and Sharepoint solutions, had to work without mail for a few days after a MS upgrade mid 2011.  In August 2011, it was MS CRM 2011 and Office 365 which suffered from outages. And again.
Every IT department has to deal with downtime one time or another.  But when an IT department serves thousands of customers with an online solution, it's high profile, big news.  And Microsoft can hopefully learn from these experiences and improve them, for an Ax cloud release later.

Another level where Microsoft has not reached the desired success (yet) is the propagation of their cloud solution platform.
Microsoft Azure platform has been around for some time now.  And strangely enough, the critics are more or less aligned on this one: A good solid offering, but MS did a bad job on marketing it.  And that's strange for a company like MS, as that has always been one of their key strengths in the past.

But it should be clear that even with recent takeovers from competitors SAP and Oracle this does not mean that Microsoft is running behind, on the contrary.  Microsoft has put its pawns on the chessboard and is (almost) ready to play.

And what about any other players than the big three? 

Google, the household name when it comes to the cloud, isn't free from glitches either.  It would also be interesting to see if they can increase the acceptance of their business solutions with business users as well.  Google depends heavily on their advertising model.  For that, they go through everything you do on the internet: all your searches, all your mail, ...
How is Google going to convince companies that their business critical data is stored safe with them?

Maybe the real threat comes from another familiar name, albeit maybe a bit unexpected here: Amazon.
Amazon, still a relatively young company, made it from an online book store to a software company.
While Amazon did not escape the run of outages in 2011, at least they communicated clearly about them.  Always.
They seem to understand the need of information of the users in such cases, in order to uphold confidence of the community in their solution.

When Denmark based ProISV, a software developer focussed on ISV's (Independent Software Vendors), released their Ax Cloud solution, they made the link with Amazon.  (Betting on two horses actually, as they also work with MS Azure.)

Maybe IBM can become an important player here.  They have the servers and infrastructure experience, they have made the transition to a services company as well.

Conclusion
The software business is on the move, to the cloud.  We gonna see lots of announcements and news stories focussing on ERP in the cloud in 2012, without doubt. 
As details of the next major release of Dynamics Ax (version 7.0, post Ax 2012) will gradually become available in 2012, it will also be exciting times for Ax customers.

Saturday, December 10, 2011

Did Dynamics Ax already make it to the cloud?

SAP is the latest to jump on the cloud bandwagon with their aquisition of SuccessFactors, an established player in cloud offerings.  First weekend of December 2011 it was announced that the deal was worth $3.4 billion, not a minor expense.  Last October we saw this other big ERP player Oracle buy RightNow for $ 1.5 billion.  Earlier in October, Oracle unveiled Oracle Public Cloud. That's when they publicly entered the cloud arena, with an 'Enterprise cloud for your business' as Oracle states it.
You can argue whether they are all just hosting solutions or real cloud solutions.  But it's clear these contenders are more then willing to link their corporate names to the cloud.  Cloud isn't about consumers anymore, it's also about enterprises.

And what about Microsoft?  And Dynamics?  Where are they?

Well with Dynamics CRM 2011 already has a cloud offering for one member of the Dynamics family of products. When it was released January 2011 the online features were a key selling point.
Dynamics NAV 7 has been postponed once or twice.  Currently slated for Fall 2012, it expects to be  run on the Azure platform.  And the client to be a webbrowser, whether NAV is running on premise or in the cloud.

At Convergence 2011 in Atlanta, Steve Ballmer already announced all members of the Dynamics family are or will be engineered to "deliver the full benefits of the cloud".  And that's with focus on Azure, Microsoft's cloud development platform.

And the recently released Dynamics Ax 2012, is that a cloud version?  The answer is 'no'. 
During the virtual launch event in August 2011 Hal Howard, corporate VP of ERP at Microsoft, already stated that Ax 7, not AX 6 will be the first real Ax cloud offering.  He repeated that statement in his keynote at the Dynamics Ax 2011 Technical Conference in Nice. 
So Ax is not the first, not even the second to make it to the cloud.

Should Ax customers and MS partners be unhappy about that?  More about that in the next blog post.

Tuesday, November 29, 2011

Error: Cannot create another system semaphore

When trying to start the Dynamics Ax AOS service, the attempt fails.
You may receive following error message:

Error: Cannot create another system semaphore

When you check the Windows event log, you may come across following error:

Fatal SQL condition during login.

Probable causes:

  1. The SQL Server service is down, verify this first.
  2. The account that has been setup to start the AOS service, does not have the proper security rights for the Ax SQL database.
Regarding number 2:
If you copy your database from one environment to another (from Production to Test for example), make sure you have the right security setup in place.  Does the startup account used for the AOS service have access to the SQL database?

Once the account has access, make sure it has proper access.
If you don't want to give it the db_owner role, make sure at least following roles are assigned to the service account

• db_ddladmin
• db_datareader
• db_datawriter




Also make sure permission to execute both stored procedures is in place.



After you verified the above, you should be able to start the AOS service.

Monday, November 28, 2011

What's wrong with the audience?

When doing development/debugging/troubleshooting, you come across the strangest things.  Error messages that don't give you the slightest idea on what's happening, or just funny ones.  Like this message from the Windows event log I found amusing:


Failed to compile audience.

Compile the audience, a whole new approach for your presentations.
The message is from SharePoint server by the way.

Friday, November 25, 2011

A touch of Dynamics Ax

One of the more interesting features of the latest version of Dynamics Ax, where I had high expectations, were the touch enabled features in the production area.
During last week's Technical Conference in Nice,  we saw a nice build up towards the demo of Manufacturing Execution, the new name of the Shop Floor module.
  • During one of the keynotes the unique position of Microsoft was highlighted.  It's the only vendor in the market that serves both consumers and businesses.  Imagine the experiences those teams can share?
    Touch screens for mobile phones are more than common these days.  We see an increase in touch functions for standard PC's with each release of Windows.  These developers of Microsoft must have tons and tons of experience with touch driven solutions.  Touch enabled features seem like an obvious thing today.  Can you imagine Windows Mango without touch?
  • Key note speakers talked about Dynamics Ax and the use of Kinect, control Ax with gestures.  There exists a software development kit, Kinect is coming to the PC.  So yes, why not bringing it on to the business floor, the ShopFloor?  Already the next step.
  • If you look at the user interface of Dynamics Ax Retail, you can't help but notice it has touch enabled features all over the place.  It's very clear what the developers had in mind when working on it.



The intro of the session was promising, as we were being introduced to the configuration of the terminal screens.   You can do some customizations there, defining different kind of terminals, configure the form layout (without developing).  Stuff like enable/disable close actions, the action pane etc.

We saw a numeric keypad, with the big buttons, and...  that was it.  Touch features ended right there.

The layout of the other forms was totally not touch oriented.  The processes were in no way adapted to the specific needs of touch.
If I see the use of the scrollbars, the way dropdown fields are used, the build up of the grid, ... Without mouse and keyboard, you are lost.

I've been working with Dynamics Ax on the production floor for almost 10 years now, making touch enabled input screens.  Customizing some interfaces or creating new ones, adapting the flow of data entry to what machine operators need.   I know when it works and even more when it doesn't work and this... 

I really hoped we would be getting something out of the box, ready to be deployed at a machine near us but no such luck.
The speaker tried to save the day, by saying stuff like 'you can always increase the font size' to set the grid height.  But he knew he wasn't very convincing.
Sorry to say, but the guys working on Ax 2012 in the production area didn't get 'touch'.  Microsoft really missed a chance here.
Still plenty of room for partners to bring in there solutions though.

But to end of with a positive note: You don't pay full price for an ME client.

Monday, November 21, 2011

myAx - a mini version of Dynamics Ax

At the end of keynote 3 at the Dynamics Ax Technical Conference 2011 in Nice, some time was reserved for Q & A.
Interesting question popped up:

Q  Is there a mini Ax version planned, for smaller companies?

I consider this question very relevant.
With each major release of Dynamics Ax, we see an increase in functionality, an increase in complexity.  Despite all the effort that goes into simplifying things: Simplifying both everyday working for users as well as implementing the solution for partners.
When more functionality is introduced, you basically introduce more possibilities. But that comes with a price.
And yes, we have RapidStart Services now.  But that's no magic wand.
You can clearly see that Microsoft positions Ax higher and higher in the market, aiming for more customers with +1000 users.  Maybe in a 2-tier setup, but if Ax is the core ERP system of the customer company that's even better.

Kees Hertogh, Director Product Management, took it upon him to answer the question and he did that very clearly.

A  No, there is no mini Ax version planned.

Don't expect anything like that either. 
"And yes, we know there exists something like mySAP, but that's not really for small companies."
His advice was equally clear:
"If you fear Ax is a too big of a bet for your company, you should consider Dynamics NAV instead."

Saturday, November 19, 2011

Cumulative update 2 for Dynamics Ax 2012 released

Even with launch events still going on all over the world, Microsoft already released cumulative update number 2 for Dynamics Ax 2012.
70+ fixes are included in the update.  RapidStart issues, performance issues with the GAB, workflow, client crashes, ... Something for everyone it seems.
This update of course includes the fixes included in update 1, that's why they call it cumulative :-)
More information can be found on the support website, over here.

Friday, November 18, 2011

NUMB3RS

The Dynamics Ax Technical Conference 2011 was all about Dynamics Ax 2012, internal version number 6.0.  Microsoft is finishing up work on the next version being 6.1, to be released Q1 of 2012.  This will include the Retail offering.  And the people of Redmond talk vividly about 6.2 or V-Next already, to be expected in 2013.  And then there's version 7.0 on the roadmap as well...

Wednesday, November 16, 2011

Nice was nice

The last slide of the last PowerPoint presentation has been shown.  The banners can be stored for a future event.
The Dynamics Ax Technical Conference 2011  has come to an end.  Lots of things learnt, exciting stuff happening, a lot to share.  Expect some bits and pieces over the next few days over on this blog. (and lots of other blogs I imagine)

Very trivial, but one of my observations to start with:

If you attend a presentation and you don't take pictures with your mobile device (be it a phone, iPad, slate, ...) of the slides shown, you belong to a minority.  Now there's some food for thought that in 2011, we have this crazy mix of digital and analog information storing.  And what a contrast with the cool video at the end of Hal Howard's keynote on day 1, showing a possible future.  Seems such a long way to go then.

Edit: Even mfp does it!

Monday, November 14, 2011

Are you crazy or ...?

A beautiful city in the south of France, at the Côte d'Azur
Relaxing temperatures, a ray of sunlight through the palm trees


And 800 people locked inside an auditorium with all the windows blinded
There must be a tech convention going on...

It's the Dynamics Ax Technical Conference 2011 at the Acropolis in Nice!

Some excellent conditions to make this a great success. But the Demo Gods are not with us...
Already saw a Visual Studio crashing, an AOS server reluctant to start up.  But other than that some good informative sessions. Answering some questions, but also bringing more to mind...
More to follow.

Wednesday, October 12, 2011

What about 'The command-line parameter -compressionminsize=1024 is invalid.' error message?

When starting the Ax client by clicking an Ax configuration file (.AXC), you may receive following error message:

The command-line parameter -compressionminsize=1024 is invalid.
Check the spelling and start Microsoft Dynamics AX again.




Possible cause, and a solution:
You are using an Ax configuration file to start Ax.  But instead of using a configuration file created for an Ax client, you are using a configuration file of the Dynamics Ax AOS server.
Make sure to use the Ax client configuration utility to create the AXC file, not the server configuration utility.

Monday, October 10, 2011

What not to forget when using the changecompany keyword

When debugging some Ax code the other day, I stumbled upon some good looking but not working code.  What at first sight looked OK, missed a small but vital detail.

The code involved the use of the changecompany keyword.  It's an easy approach for reading records from different company accounts within one Ax database.
The syntax is pretty straightforward:

   changecompany('id')
   {
       // record handling
   }

Put the record handling between accolades and you are good to go.  But...


Example of some disfunctional code:

static void MyExample(Args _args)
{
   DataArea DataArea;
   CustTable CustTable;
   ;

   while select DataArea
      where !DataArea.isVirtual
   {
      changecompany(DataArea.id)
      {
         while select CustTable
            where CustTable.Name like 'A*'
         {
            info(strfmt("%1 %2 %3",CustTable.dataAreaId,CustTable.AccountNum,CustTable.Name));
         }
      }
   }
} 

The above does not work or gives unreliable results.
What to do: You have to reset your table variable, after the changecompany but before your perform the record handling..
Example of some working code:

static void MyExample(Args _args)
{
   DataArea DataArea;
   CustTable CustTable;
   ;

   while select DataArea
      where !DataArea.isVirtual
   {
      changecompany(DataArea.id)
      {
         CustTable=null;          // remember to reset the record object
         while select CustTable
            where CustTable.Name like 'A*'
         {
            info(strfmt("%1 %2 %3",CustTable.dataAreaId,CustTable.AccountNum,CustTable.Name));
         }
      }
   }
} 

Wednesday, September 28, 2011

Microsoft opening up the vault of KB articles

Up until now, access to Knowledge Base articles for Dynamics Ax was limited to people with access to either CustomerSource or PartnerSource.  This also means access to people with a valid Service Plan for Ax.
Microsoft decided a while ago to align it's policy regarding KB's for Dynamics Ax with other MS products.  This means that all KB articles are now publicly available, no restraints.  Which of course makes it a lot easier to reference them in communication between partners and customers, on internet fora etc.  And it makes them accessible to search engines as well, helping to spread the information.

You can search for any KB over here:

Microsoft Support

or with this more specific link for Ax:

Dynamics Ax Solution Center

30.000+ articles are already available.  And new KB's will be created with a public profile.

Monday, September 19, 2011

Switcher

Microsoft is gaining market share with the Dynamics suite, but only marginally.  Today it still is not a real threat to number one, SAP.  In fact, they are profiling Dynamics Ax as an addendum to SAP, king of the Tier 1 throne.  With Dynamics Ax for subsidaries, branch offices.
 
But with the introduction of Dynamics Ax, they really do target a competitor.  And that competitor is Lawson, with is S3 and M3 software.  Please remember, Lawson is now part of Infor.  Infor has the same ambitious plan as Microsoft had almost 10 years ago: Create one single ERP suite, with one code base.
But as you know, any take-over comes with some uncertainties for both customers and partners.  And Microsoft hopes to benefit from that uncertainty.

Two initiatives under one name are launched: the Switcher campaign.

  • Microsoft is giving up to 50% discounts on the standard list price of Ax 2012, for customers switching from current Lawson ERP software to Dynamics Ax 2012
  • Secondly there is a reimbursement for partners investing in training and certifying their Lawson consultants in Ax 2012
The name of the campaign sounds like a new television series, airing Friday evening.  But it's not, it's real and tempting for people involved with Lawson software today.
And while it will not create a landslide, it will certainly add some percentage points of growth to Microsoft's customerbase and it's partner ecosystem.

Thursday, September 8, 2011

Electronic concrete

Virtual Launch event of Microsoft Dynamics Ax 2012 today.  Can't miss it!  Microsoft really pulled out the big guns.  Steve Ballmer, Kyril Tatarinov, Hal Howard, ...

A one hour event, with a nice mix of promotional talk, some demo's, user experiences.  The message is clear:
  •    Ax 2012 is released
  •    soon on a computer near you
  •    in better shape then ever...
More to come.

Oh and the title of this post?  Microsoft compared deploying it's competitor's ERP as like 'pouring electronic concrete'.  Pretty vivid image, not?

Wednesday, August 3, 2011

Dynamics Ax 2012 is compatible with Windows 7 - Did you expect otherwise?

It looks like a formality, but still they have to go through the proces.  After Dynamics Ax 2009 already got a green light (see here and here), and since Windows XP is no longer supported for Ax 2012 (see here), it was now time to put Dynamics Ax 2012 to the test.

The results of the jury (we didn't expect anything else): Microsoft Dynamics Ax 2012 is compatible with Windows 7.  Now it's official.   (Both 32 bit and 64.)

This means it passed Microsoft installation, performance, reliability, and security tests.
And they can put that on the box :-)