· Oct 12, 2020

Creating index combining List(ELEMENTS) and another standard Property


I'm trying (and not succeeding) to build an index based on a collection property combined with a property, like:

Index Test On (Property, ListProperty(ELEMENTS).Property2)


For example, I have a class with this properties:
Property Simple As %String;
Property ListOfProp As List Of AnotherObject;

The, I try to create a simple index of one of the AnotherObject properties and I can compile and it creates the right index:
Index Test On (ListOfProp(ELEMENTS).Name);

But when I add a "normal" property, compiler miserably fails:
Index Test On (Simple, ListOfProp(ELEMENTS).Name);

 Compiling routine 
ERROR: TestingClass.cls(%SaveData+50) #1079: Invalid JSON string syntax : '^TestingClassI("Test",$zu(28,zzc33v2,7,32768),$zu(28,{UNRESOLVED:ListOfProp(ELEMENTS).%%OREF*O}.Name,7,32768),id)' : Offset:73 [%SaveData+49^TestingClass.1]
 TEXT: kill ^TestingClassI("Test",$zu(28,zzc33v2,7,32768),$zu(28,{UNRESOLVED:ListOfProp(ELEMENTS).%%OREF*O}.Name,7,32768),id)
Detected 1 errors during compilation in 0.156s.

Is there any special option I need to add there? Somebody has struggled with it before?

Discussion (4)1
Log in or sign up to continue