Search code examples
intersystems-cacheintersystems

Intersystems Cache - Correct syntax for %ListOfObjects


The documentation says this is allowed:

ClassMethod GetContacts() As %ListOfObjects(ELEMENTTYPE="ContactDB.Contact") 
[WebMethod]   

I want to do this:

Property Permissions As %ListOfObjects(ELEMENTTYPE="MyPackage.MyClass");

I get an error:

ERROR #5480: Property parameter not declared: MyPackage.Myclass:ELEMENTTYPE

So, do I really have to create a new class and set the ELEMENTTYPE parameter in it for each list I need?


Solution

  • Correct syntax for %ListOfObjects in properties is this one

    Property Permissions As list of MyPackage.MyClass;