Skip to main content

Notifications

Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

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

(0) ShareShare
ReportReport
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

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,359 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans