I have a product table and Product BOM table
The Product BOM table has a link with the other two tables (PrdCode from ProductTable and PrdAtb from AttributeTanle) to get data based on the id.
If I load Product BOM in a normal grid all data including data from other tables using join is populating with the following query in profiler;
SELECT TOP 100
T0.[Bom_Id] AS [BomId],
T0.[Prd_Id] AS [PrdId],
T0.[Prd_Bom_Id] AS [PrdBomId],
T0.[Bom_Atb_Id] AS [BomAtbId],
bAtb.[Prd_Atb] AS [BomAtb],
T0.[Certificate_no] AS [CertificateNo],
T0.[Pieces] AS [Pieces],
T0.[Weight] AS [Weight],
T0.[Calc_On] AS [CalcOn],
T0.[Rate] AS [Rate],
T0.[Amount] AS [Amount],
T0.[Remarks] AS [Remarks],
jPrd.[Prd_Code] AS [PrdCode],
jPrd.[Prd_Name] AS [PrdName]
FROM [dbo].[tbl_Product_Item_Bom] T0
LEFT JOIN [dbo].[tbl_Common_Attributes] bAtb ON (bAtb.[Prd_Atb_Id] = T0.[Bom_Atb_Id])
LEFT JOIN [dbo].[tbl_Product_Master] jPrd ON (jPrd.[Prd_Id] = T0.[Prd_Bom_Id])
ORDER BY T0.[Bom_Id];
SELECT count(*)
FROM [dbo].[tbl_Product_Item_Bom] T0
LEFT JOIN [dbo].[tbl_Common_Attributes] bAtb ON (bAtb.[Prd_Atb_Id] = T0.[Bom_Atb_Id])
LEFT JOIN [dbo].[tbl_Product_Master] jPrd ON (jPrd.[Prd_Id] = T0.[Prd_Bom_Id])
but when the same row using in product detail view data from join is blank where profiler shows the following query;
T0.[Bom_Id] AS [BomId],
T0.[Prd_Id] AS [PrdId],
T0.[Prd_Bom_Id] AS [PrdBomId],
T0.[Bom_Atb_Id] AS [BomAtbId],
T0.[Certificate_no] AS [CertificateNo],
T0.[Pieces] AS [Pieces],
T0.[Weight] AS [Weight],
T0.[Calc_On] AS [CalcOn],
T0.[Rate] AS [Rate],
T0.[Amount] AS [Amount],
T0.[Remarks] AS [Remarks]
FROM [dbo].[tbl_Product_Item_Bom] T0
WHERE ((T0.[Prd_Id] = 50))
ORDER BY T0.[Bom_Id]
also UI is populated using listrequest wheras detail is populated using Retriverequest
can someone please shed some light where I am doing wrong
put [MinSelectLevel(SelectLevel.List)] on top of the detail's foreign fields you want to select.
Or, better use the IncludeColumns parameter to select those columns
Solved using @dfaruque solution.
Thanks
Most helpful comment
put
[MinSelectLevel(SelectLevel.List)]on top of the detail's foreign fields you want to select.