My 2p about ERP Solutions, Information Worker Solutions and other software products (mainly Microsoft Dynamics AX and Microsoft SharePoint).

31 December 2009

Links List December 2009

I decided to share all my interesting reads and resources month by month with my blog readers. You can find these posts by searching on the label Links. I'll try to order the resources in logical categories. If you would like to see some interesting stuff added in the next month, don't hesitate to post a comment.

So this is my Links post for December 2009.

Dynamics AX

Blogging – Blogging Tips


Continue reading......

by Patrik Luca 0 comments

01 December 2009

Week numbers in Dynamics AX

Introduction: Week numbers in Dynamics AX

This post is about showing the week number in date controls in Dynamics AX. This was by default shown in Axapta 3.0, but disappeared since Dynamics AX 4.0. The second part of this post describes how you can adapt the week number calculation, as there are different numbering systems.

Showing the week number in date controls in Dynamics AX

To show the week number in date controls, adapt the SysDateLookup form by setting the property ShowRowLabels of the control DaysTable to Yes (which was the default in Axapta 3.0 BTW, so for Axapta 3.0 installations, it is shown anyway.).

Changing the numbering system for weeks

According to the ISO week date system, the first week of the  year is the week containing a Thursday. Whereas in some countries it is more common to see the first week of the year as the one containing January, 1st. The latter is how the date control in standard Dynamics AX is working as you can see below.

To change this, adapt the method drawMonth of form SysDateLookup as follows:

//daysTable.setRowLabel(w,num2str(weekOfYear(
// drawingDate+firstDayOfWeek)
// ,2,0,0,0));
daysTable.setRowLabel(w,num2str(wkOfYr(
drawingDate+firstDayOfWeek)
,2,0,0,0));


This will result in following week numbering:





So there is a difference between the function weekOfYear vs wkOfYr in Dynamics AX, which becomes very clear if we create a small job:



static void CalculateWeekOfYear(Args _args) 
{

    ;

    info(strFmt("weekofYear 05.01.2010: %1"
,weekOfYear(str2date("05.01.2010",123))));
    info(strFmt("wkOfYr 05.01.2010: %1"
,wkOfYr(str2date("05.01.2010",123))));

}

 



Output:





Continue reading......

by Patrik Luca 7 comments

Patrik Luca, Ieper, BELGIUM
Feel free to use or spread all of the content on my blog. In return, linking back to my blog would be greatly appreciated. All my posts and articles are provided "AS IS" with no warranties.

Subscribe feeds via e-mail
Subscribe in your preferred RSS reader

Subscribe feeds rss Most Read Entries

Categories

Recommended Books


Subscribe feeds rss Recent Comments

This Blog is part of the U Comment I Follow movement in blogosphere. Means the comment field of this blog is made DOFOLLOW. Spam wont be tolerated.

Blog Archive

My Blog List

Followers

Links