web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to search for specific value in the List

(0) ShareShare
ReportReport
Posted on by

Hello,

How can I search for specific values in the List collection (x++ syntax)? I am adding items to the custom list class and I would like to be able to check if a specific element already has been added.

Thanks 

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Jesus R. ABASCAL Profile Picture
    1,450 on at

    I recommend you to use Set Class

    Set class has "in" method that determines whether a particular value is a member of the set.

    msdn.microsoft.com/.../aa861938(v=ax.50).aspx

  • Verified answer
    Martin Dráb Profile Picture
    237,926 Most Valuable Professional on at

    List doesn't such a method - you have to iterate its elements.

    As Jesús said, a Set would be a good choice for such a task, if possible in your scenario.

  • Community Member Profile Picture
    on at

    Thanks guys. I am going to try this. Cheers.

  • Community Member Profile Picture
    on at

    It has worked. Thanks a lot.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans