I'm using the ObjectQuery API to retrieve data from a custom table which is generated by Kentico and inherits from SKUTreeNode.
When I join it with the Com_Sku table ( with SKUInfo ), I'm getting an error.
The example code I use is:
var test = CustomProductProvider.GetCustomProducts()
.Source(sourceItem => sourceItem.Join<SKUInfo>("no", "SKUNUMBER")).FirstOrDefault();
The error is "Invalid column name 'no'.", while this column belongs to the product table.
The query which is generated is ( I excluded the where-clause ):
FROM View_CMS_Tree_Joined AS V WITH (NOLOCK, NOEXPAND) INNER JOIN custom_product AS C WITH (NOLOCK) ON V.DocumentForeignKeyValue = C.tableID AND V.ClassName = N'custom.product' LEFT OUTER JOIN COM_SKU AS S WITH (NOLOCK) ON V.NodeSKUID = S.SKUID INNER JOIN COM_SKU ON S.no = COM_SKU.SKUNUMBER
Why can't I join or how can I retrieve the information in the custom table joined by the COM_SKU table?
Id say double check to see if the columns are really added.
Please, sign in to be able to submit a new answer.