I have a need to know all actions of pages, I've found a table called "Page Action" and the issue is when I want to loop over it to populate all actions, suddenly the application crashes, IDK maybe the table have many records that's why?
procedure populateActions(): Integer
var
PageAction: Record "Page Action";
begin
PageAction.Reset();
if PageAction.FindSet() then begin
repeat begin
Message(PageAction.Name);
end until PageAction.Next() = 0;
end;
end;
I tried also to populate each page separately with for loop it crashes again
procedure populateActions(): Integer
var
PageControlFields: Record "Page Control Field";
PageAction: Record "Page Action";
pagesId: list of [Integer];
id: Integer;
begin
PageControlFields.Reset();
if PageControlFields.FindSet() then begin
repeat begin
pagesId.Add(PageControlFields.PageNo);
PageControlFields.SetFilter(PageNo, '<>%1', PageControlFields.PageNo);
end until PageControlFields.Next() = 0;
end;
for id := 1 to pagesId.Count do begin
PageAction.Reset();
PageAction.SetRange("Page ID", pagesId.Get(id));
if PageAction.FindSet() then begin
repeat begin
Message(PageAction.Name);
end until PageAction.Next() = 0;
end;
end;
end;
But if I loop just from 1 to 10 it works?
Any help is much appreciated