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

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,794 Moderator on at

    Hi,

    Please share the code.

    Thanks.

  • Suggested answer
    YUN ZHU Profile Picture
    99,086 Super User 2026 Season 1 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

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,005 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,148 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 557 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans