Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

finding min value in array

(0) ShareShare
ReportReport
Posted on by 785

Hello everyone,

I know it sounds strange but I need to find a min value in Array. Is there any standard method to do this? I checked collection class Array from here - https://docs.microsoft.com/en-us/previous-versions/dynamics/ax-2012/system-classes/gg802677(v=ax.60)?redirectedfrom=MSDN and I haven't found anything like that. Does that mean I need to create a primitive array and then traverse through it to find  a min value? For me it looks strange as there should be something standard inside AX to do this, I think.

Thanks.

  • Verified answer
    ergun sahin Profile Picture
    ergun sahin 8,812 Super User 2024 Season 1 on at
    RE: finding min value in array

    I don't think so either. The closest I remember should be a method named min (). You can't use it in Array, but at least it gets rid of ifs.
    If I remember correctly it was used as below;

    int     minValue        = min(21,50,5,120);
    real    minRealValue    = min(20.1,15.2,15.1,30.1,50);

  • dark_knight Profile Picture
    dark_knight 785 on at
    RE: finding min value in array

    Hello Martin,

    Thanks for the answer. In that case I'll go for the primitive array and traverse through its elements.

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,836 Most Valuable Professional on at
    RE: finding min value in array

    No, I'm not aware of any such a method.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,836 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans