Create index from a property in a list - SOLVED

Primary tabs

Hi,

I know of the existance of (ELEMENTS) to create an index from a list, but I actually would like to index the content of an element of a list. Is it possible?

 

My scenario:

Class:
Property Test As list of TestList;
 

Test.List:
Property Name As %String;
Property Surname As %String;

I would like to have an  index based on the TestList.Name. If I try using

Index NewIndex On Test(ELEMENTS)

it will create an index with Name and Surname in it, but I just want to have an index with the name. Is it possible? 

  • 0
  • 1
  • 117
  • 2
  • 1

Answers

Sorry, I just saw I can do:

Index NewIndex On Test(ELEMENTS).Name

Comments

Hi David!

Great you've found the answer by yourself! It happens to me sometimes right after I end writing a question)

There is no need to add "Solved" to the title to indicate the question is closed. We have the feature of an accepted answer. So you can mark your answer as Accepted and this will be the indicator for the question as solved and it will disappear from the filter of Not accepted answers.

Thanks for your contribution!