cancel
Showing results for 
Search instead for 
Did you mean: 

How do you create a Reuse Library function to return a collection of objects?

bunting_moses
Discoverer
0 Kudos
I frequently need to return all instances of a particular configuration object, so rather than define and execute the query everywhere I need to, I just want to write a reuse function that does it with one line of code in the client script.

When I define the reuse function, it forces me to include the "elementsof" option, which then causes problems getting the collection.

I define and execute QueryByElements to return all IDs, then retrieve each instance and try to add it to the results.

But I get a message like this when trying to activate -

Return fails: Assignment of the type 'collection of MyCustomObjectNodeElements' to the type 'collection of Node(MyCustomObject.Root)' is not possible

I can't even tell what "elementsof" is really useful for. Nearest I can figure from the documentation is that it creates an empty instance that is useful for creating a new instance of the object.

Any help is appreciated.

Accepted Solutions (0)

Answers (0)