Alfasith AX

Alfasith AX
اللَّهُمَّ انْفَعْنِي بِمَا عَلَّمْتَنِي، وَعَلِّمْنِي مَا يَنْفَعُنِي، وَزِدْنِي عِلْمًا

Wednesday, April 24, 2024

How find size of recordsortedlist in D365/AX 2012

Hi,


This is the continuity of the previous article where we are now getting the size of recordsortedlist .


if(recordsortedlist.len() >1)
{
    print("Given recordsortedlist is bigger than 1");
}

Thanks,

How find size of List in D365/AX 2012

Hi,

public int listLengthCounter(List list)
{
Enumerator enumerator;
int length = 0;
;
enumerator = list.getEnumerator();
while(enumerator.moveNext())
{
length++;
}
return length;
}

But List has such a direct funtion


 if (list.elements() > 1) 
    { 
        print "It has has more than 1 elements"; 
    } 

Thanks

How find size of recordsortedlist in D365/AX 2012

Hi, This is the continuity of the previous article where we are now getting the size of recordsortedlist . if(recordsortedlist.len() >1) ...