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
Showing posts with label List. Show all posts
Showing posts with label List. Show all posts
Monday, April 22, 2024
Find smallest date from a set of dates using X++
Thursday, April 22, 2021
How to get the number of elements in the list in AX
{
List il = new List(Types::Integer);
il.addStart(1);
il.addStart(2);
il.addStart(3);
if (il.elements() != 3)
{
print "Something is wrong...";
}
}
Subscribe to:
Posts (Atom)