I'm creating a section that has a 2-layer document structure:
Category 1
Item 1
Item 2
Category 2
Item 1
Category 3
Item 1
Item 2
Item 3
I've created a custom document type for each layer, TestCategory and TestItem. When a user is adding an Item, I allow them to select a TestCategory which the TestItem should fall under, using the "Drop-down list" field type. I'm populating that list using the SQL query:
SELECT TestCategoryID as value, TestCategoryName as text
FROM bluerhino_BRProductCategory
ORDER BY ProductCategory
The TestCategoryID is stored in the TestItem's table, but I'd like to also be able to access the TestCategoryName (for display purposes) on the TestItem pages.
I thought that I could manually change the View_bluerhino_TestItem_Joined view and add a inner join to the TestCategory table on the category ID's and pull in TestCategoryName to the result set. I did that, and selecting from that view in SQL manager works fine.
However, when I tried to code it on a TestItem page, the CMSContext.CurrentDocument.DataRow does not have a TestCategoryName column.
Does CMSContext.CurrentDocument not get filled by the "selectdocuments" query, or am I doing something else wrong?