Get All AppClasses in an AppPackage
PeopleCodeThis example code creates an array of all AppClasses in an AppPackage. Useful for some patterns that use multiple classes of the same type.
The crux of this is some SQL:
This all assumes an interface, and that all AppClasses in the AppPackage are of this type.
The Array is an array of the same interface.
The SQL filters out the interface itself: and appclassid <> :3
If your classes take parameters when creating you’ll need to mod or extend or whatever the above to use CreateObjectArray(Class_Name, Array_of_Args) instead.
I’ve just slapped the above together, mainly so that I can recall the SQL involved in future. I haven’t even tested it. Should be close though, and the main bit is really the SQL.