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

Is there a way that I can specify page extension to be applied only in some pages?

(0) ShareShare
ReportReport
Posted on by 47
I have made a pageextension extend the page "Document Attachment Details" and I added a button in the actions section which allows viewing the document attached.
but it shows overs all pages (customer, invoices, items)
My question is How can I specify that only the page sale invoices can see that button of pageextension?
I have the same question (0)
  • Suggested answer
    Nitin Verma Profile Picture
    21,698 Moderator on at

    Hi,

    Please share the code.

    Thanks.

  • Suggested answer
    YUN ZHU Profile Picture
    95,329 Super User 2025 Season 2 on at

    Hi, This is because this page is generic and the changes you make to it will be reflected on other pages as well.

    pastedimage1664241604547v1.png

    You should be able to do that if you add a new Action.

    pastedimage1664241678255v2.png

    For example, the button is only displayed when opened from customer list.

    pastedimage1664242545114v3.png

    pastedimage1664242551608v4.png

    From other page:

    pastedimage1664242594356v5.png

    Source code:

    pageextension 50105 SalesOrderListExt extends "Document Attachment Details"
    {
        actions
        {
            addfirst(processing)
            {
                action(NewAction)
                {
                    Caption = 'New Action';
                    Image = New;
                    Promoted = true;
                    PromotedCategory = Process;
                    ApplicationArea = All;
                    Visible = IsVisible;
    
                    trigger OnAction()
                    begin
                        Message('Test Action');
                    end;
                }
            }
        }
    
        var
            [InDataSet]
            IsVisible: Boolean;
    
        procedure SetActionIsVisable()
        begin
            IsVisible := true;
        end;
    }
    
    pageextension 50111 MyExtension extends "Customer List"
    {
        actions
        {
            addfirst(processing)
            {
                action(OpenDocumentAttachmentDetails)
                {
                    Caption = 'New Document Attachment Details';
                    Image = New;
                    Promoted = true;
                    PromotedCategory = Process;
                    ApplicationArea = All;
    
                    trigger OnAction()
                    var
                        DocumentAttachmentDetails: Page "Document Attachment Details";
                    begin
                        DocumentAttachmentDetails.SetActionIsVisable();
                        DocumentAttachmentDetails.Run();
                    end;
                }
            }
        }
    }

    Hope this helps.

    Thanks.

    ZHU

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 3,229

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,867 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,153 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans