Number of Months between two dates

I got a situation where I need to calculate the number of months between 2 dates, I found a built in method in dynamics ax 2012 that can be used. noOfIntervals = intvNo( inputDate,refDate, intvScale::Month); intvScale enumation have two values for months â—¾Month (X++ ignores the year and assumes that month is calculated within one … Continue reading Number of Months between two dates

Advertisements

Number of days in Month /Last day of month

end month (today())// will return the last day date . dayofmonth(today()) // returns the Numeric day of date.   dayofmth(endmth(mkDate(today()))) // this will returns the number of days in a month

Create Employee/Worker using code

Sample job to create worker/Employee static void JobToCreateNewEmployee(Args _args) { DirPersonName DirPersonName; DirPersonName.initValue(); DirPersonName.FirstName = "Test"; DirPersonName.LastName = "Empl"; HcmWorkerTransition::newCreateHcmWorker(DirPersonName, "TestEmployee"); }