X++ Coding: How to calculate the working days?

Hi all,

I would like to calculate the working days from 1 Feb to 25 Feb 2012, is any function that I could calculate the working days, thanks.

Best Regards,

MC.

Hi Michael ,

you have to use a calendar (Basic > Calendar) to define working days (you can even use different calendars for individual vendors, for example 14 Feb is holiday . With a calendar, you can call the WorkCalendarSched class, method schedDate().

Hi Rajkumar,

Thanks for your help. I have set the Base–> calendar for working days. If I would calculate the working days between 13/2 to 19/2. Assume 14/2, Saturday and Sunday is holiday. Any function or coding could help to solved it.

Thank you very much for your help.

Hi Michael,

I have the problem same to you. Now, I don’t know solve how? Did you solve of this problem? If ok, please help me.

there is class > TSPeriod in ax 2012 it might usefully for you.

Hi srikanth,

That is useful share, but i using Ax2009**.**

Thank you your reply.

Ok, so I made the following simple code that works (AX2012). My calendar name is “Standaard” I hope it will help someone:

1 Like