Announcements
Hi All
I'm trying to generate a report that reads from a temporary table. However, the temporary table should be populated from a Query when a user runs the report. So far no data pulls through (empty error).
I have used pattern from Dynamics 365 Business Central: Using the query as a data source for a page (Query.Open Method) | Dynamics 365 Lab (yzhums.com)
So far this is my code and I have tried triggers predataItem and onaftergetrecord:
column(Lot; Lot) { } column(Serial; Serial) { } trigger OnPreDataItem() var LotByBinTemp: Record LotByBinTemp; LotByBinQuery: Query LotNumbersbyBin; begin LotByBinTemp.DeleteAll(); if LotByBinQuery.Open() then begin while LotByBinQuery.Read() do begin LotByBinTemp.Init(); LotByBinTemp.RowNo := LotByBinTemp.RowNo 1; LotByBinTemp.Location := LotByBinQuery.Location_Code; LotByBinTemp.ItemNo := LotByBinQuery.Item_No; LotByBinTemp.Lot := LotByBinQuery.Lot_No; LotByBinTemp.Serial := LotByBinQuery.Serial_No; LotByBinTemp.Insert(); end; LotByBinQuery.Close(); end; End;
Dear Samantha,
Have you succeded in meeting out the above requirement..? If so, please share the ways to achieve it..
Thanks in advance,
Saravanan M
I wonder if you are filling your temp table too early in the process?
What is the dataitem for your report?
Maybe you can share more of the code?
André Arnaud de Cal...
293,716
Super User 2025 Season 1
Martin Dráb
232,694
Most Valuable Professional
nmaenpaa
101,158
Moderator