Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum
Unanswered

I can't populate records of table "Page Action"?

Posted on by 7

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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,532 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,501 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans