ListEnumerator listEnumerator; list listDates = new list(Types::Date); listDates.addEnd(Date1); listDates.addEnd(Date2); listDates.addEnd(Date3); listDates.addEnd(Date4); TransDate lowestDate = dateMax(); if (listDates.elements() > 0) { listEnumerator = listDates.getEnumerator(); while (listEnumerator.moveNext()) { if(listEnumerator.current() <= lowestDate && listEnumerator.current() != dateNull()) { lowestDate = listEnumerator.current(); } } } if(lowestDate != dateNull() && lowestDate != dateMax()) { info(lowestDate); }
This blog is contains coding reference related to Microsoft AX 2012 and D365 finance and operations and Power platform
Monday, April 22, 2024
Find smallest date from a set of dates using X++
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment