but tvItem is not declared. is it possible to return the collection?
You are getting the error, "tvItem is not declared" because it is just the definition of the data type - not an instance of the data type. When using user defined types, you have to create an instance of the type in order to use it as a returnable type in your function. You should use "MyCollection" as the return instead. Also, this my just be a typo, but your declaration of "MyCollectiontvItem" should be "MyCollection tvItem".
1 person found this helpful
if you want to use a type "outside" the package body, and thats what you want to do, then you have to define the type in the package sepcification, not in the body.
Thanks a lot for your answer Craig and Andreas.
Everything works now!