web
You’re offline. This is a read only version of the page.
close
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 3,255

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,062 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,664

#2
YUN ZHU Profile Picture

YUN ZHU 960 Super User 2025 Season 2

#3
Jainam M. Kothari Profile Picture

Jainam M. Kothari 773 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans