web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
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 3,299

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.';

I have the same question (0)
  • Suggested answer
    Vaishnavi J Profile Picture
    3,094 on at

    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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,024 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,145 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 705 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans