AX 2012

First and last date of last Week AX 2012

Posted on

Below job will return the First and Last day of last week static void LastWeekFirstandlast(Args _args) { FromDate fromDate; ToDate toDate; TransDate baseDate = systemDateGet(); ; toDate = dateStartWk(baseDate) – 1; fromDate = dateStartWk(toDate); info(strFmt(“%1 – %2”, fromDate, toDate)); }

AX 2012

First and last date of last month AX 2012

Posted on

code calculates the first and last date of the previous month static void EP_dateMonthInterval(Args _args) { date fromDate; date toDate; date baseDate = systemDateGet(); ; toDate = dateStartMth(baseDate) – 1; fromDate = dateStartMth(toDate); info(strFmt(“%1 – %2”, fromDate, toDate)); }