Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

Action on purchase line to display change log entries linked

(0) ShareShare
ReportReport
Posted on by 2,663

Hi All

I'm trying to create an action that filters change log entries for the selected purchase order line. However, in change log entries table, line no is text so the code shows an error when trying to filter by line no which is integer on purchase line table:


                RunObject = Page "Change Log Entries";
                RunPageLink = "Primary Key Field 2 Value" = FIELD("Document No."),
                                "Primary Key Field 3 Value" = Field("Line No."),//Text to integer error
                              "Table No." = FILTER(39),
                              "Type of Change" = FILTER(Modification),
                              "Primary Key Field 1 Value" = FILTER(1);
                ToolTip = 'Opens change log and display modifcations to Selected PO Line.';

  • Suggested answer
    Vaishnavi J Profile Picture
    3,058 on at
    RE: Action on purchase line to display change log entries linked

    Hi,

    You can write the above logic in this way which will open the change log entries.

     trigger OnAction()
                    var
                        PageChangeLogentries: Page "Change Log Entries";
                        Rec_ChangeLogEntries: Record "Change Log Entry";
                    begin
                        Clear(Rec_ChangeLogEntries);
                        Rec_ChangeLogEntries.Reset();
                        Rec_ChangeLogEntries.SetRange("Primary Key Field 2 Value", Rec."Document No.");
                        Rec_ChangeLogEntries.SetRange("Primary Key Field 3 Value", Format(Rec."Line No."));
                        Rec_ChangeLogEntries.SetRange("Table No.", 39);
                        Rec_ChangeLogEntries.SetRange("Type of Change", Rec_ChangeLogEntries."Type of Change"::Modification);
                        if Rec_ChangeLogEntries.FindFirst() then begin
                            Clear(PageChangeLogentries);
                            PageChangeLogentries.SetTableView(Rec_ChangeLogEntries);
                            PageChangeLogentries.Run();

                        end;
                    end;
    If my answer was helpful to you, please verify it so that other users know it worked. Thank you very much

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,886 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,766 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans