gatsby0121
-
4/26/2011 5:47:20 AM
Where condition using multiple document types
Me again.
So I've created two document types, Resources, and resource articles.
I have another document type where I've created a select list which pulls all resources and resource articles, and allows the user to select from them.
I've then created a repeater, and for the where clause I'm using a custom macro that goes in and grabs all resources and resource Articles, where the resource id is equal to the selected items in the list. I had to make the document id equal to "resourceID" for both, or else I received a column not found when checking "where resourceid in '' or resourcearticleid in '' ".
The problem is if the user only selects "Resource" document types, or only selects "resource article" document types, but not from both.
The system will display all resources selected, but then a "[CMSAbstractTransformation.DataBind]: Object reference not set to an instance of an object." Error.
I assume this is because it is also doing a search in the database for whichever document type was *not* selected, and the dataset is empty.
The error is occuring in the temporary template but probably being passed up from another control. Where can I edit the offending code to not return an error if it's empty?
|