I am trying to create a page on a temporary table using VS Code. The page does not show the records as expected. It lists few records from the table and then restart the listing from the first record instead of showing the rest of the records.
To illustrate you the example. Let's say I want to show items on the list page. The source table needs to be temporary (for x reason).
Here is the code which works perfectly if I am using Object Designer, but does not work if I am using the VS Code.
Does anyone have any idea?
page 50103 ItemTempPage
{
PageType = List;
SourceTable = Item;
SourceTableTemporary=true;
layout
{
area(content)
{
repeater(Group)
{
field("No.";"No.")
{
}
}
}
area(factboxes)
{
}
}
var
TempItem: Record Item temporary;
Item: Record Item;
trigger OnOpenPage();
begin
LoadPage;
end;
trigger OnFindRecord(Which : Text) : Boolean;
begin
TempItem.Copy(Rec);
if TempItem.Find(Which) then
begin
Rec:=TempItem;
exit(true);
end
else
exit(false);
end;
trigger OnNextRecord(Steps : Integer) : Integer;
var ResultSteps:Integer;
begin
TempItem.Copy(Rec);
ResultSteps:=TempItem.NEXT(Steps);
if ResultSteps<>0 then
Rec:=TempItem;
exit(ResultSteps);
end;
local procedure LoadPage();
begin
if Item.FindSet then
repeat
TempItem.init;
TempItem.Copy(Item);
TempItem.Insert;
until Item.Next=0;
end;
}
0