Serenity: Detail Grid not loading data from join

Created on 6 Nov 2019  路  3Comments  路  Source: serenity-is/Serenity

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

Most helpful comment

put [MinSelectLevel(SelectLevel.List)] on top of the detail's foreign fields you want to select.

All 3 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chintankukadiya18 picture chintankukadiya18  路  3Comments

gfo2007 picture gfo2007  路  3Comments

Shraddha996 picture Shraddha996  路  3Comments

Pinellus picture Pinellus  路  3Comments

ga5tan picture ga5tan  路  3Comments