Building additional SQL views in Aptify Association and Membership Management Software can sometimes require you to use SQL temporary tables in your view.
If you then attempt to create a database object from said view:
You will get an Aptify Exception error that will include “Views or functions are not allowed on temporary tables. Table names that begin with ‘#’ denote temporary tables.”
To get around this problem:
Take the T-SQL involving the temp table and port it into a table-based function that is called by the view.
The issue comes from the way Aptify enumerates everything returned by the SELECT statement and cannot handle temp tables in a view. Functions don’t have the same restrictions, though, and can be used to return the needed data.