Search This Blog

How to Calculate Week No. Month Wise from a Date NAV RDLC (Starting Weekday "SUNDAY")

In Navision RDLC if we want Week No. Month Wise i.e. if a invoice is posted on 15/04/2016 then Week no. should come 3.

Note : Initially week starts from Monday but what if we want week no. of a month where week starts from Sunday.

When you are developing a Report in NAV with a Requirement that with Posting Date you also have to provide Week No. in which that particular Posting Date comes. (Month Wise with starting week day "Sunday").


As per the above requirement given below are the required Variables & Code for the same.


##C/AL Globals (Variables) :

Name               DataType         Subtype
DateRec          Record                   Date
WeekNo          Integer
StartDate         Date
EndDate          Date
Ctr                   Integer
PDStartDate    Date
PDEndDate     Date
PDStartBLN   Boolean
DStartDate      Date
DEndDate       Date


##Code on Trigger (On After Get Record) :