VS Code and pages on temp tables does not work
Befiti
Member Posts: 6
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;
}
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
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 333 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions