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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

Create page that allows the user to modify a disabled field

(0) ShareShare
ReportReport
Posted on by 92

Sometimes users forget to fill in the "Fiscal Invoice Number PAC" field in the Purchase Invoices and since when the invoices are registered they can no longer be modified, I would like to create a page that allows to modify said field of the Posted Purchase Invoice page . Any idea how I could do this? I'm lost

I have the same question (0)
  • Suggested answer
    Mohana Yadav Profile Picture
    61,223 Super User 2026 Season 1 on at

    Please look at Update Document Action and extend the page with required field

    update-posted-doc.jpg

  • Suggested answer
    IB-29041624-0 Profile Picture
    1,191 Moderator on at

    I do not have that field in my version of Business Central.

    But something like this should work:

    pageextension 50101 PostedPurchaseInvoiceExt extends "Posted Purchase Invoice"

    {

       layout

       {

           modify("Fiscal Invoice Number PAC")

           {

               Editable = true;

           }

       }

    }

    If that field is marked as none editable in the table definition you might have to do a workaround for that.

  • Suggested answer
    YUN ZHU Profile Picture
    102,123 Super User 2026 Season 1 on at

    Hi, I am leaning towards Mohana's solution, for example, I want to add a change to the Payment Term Code in Posted Purchase Invoice.

    pastedimage1649899066888v1.png

    pastedimage1649899079131v2.png

    Add new field to "Posted Purch. Invoice - Update" page.

    pastedimage1649899131572v3.png

    pastedimage1649899403475v4.png

    pastedimage1649899412932v5.png

    pastedimage1649899944087v6.png

    Source code:

    pageextension 50111 MyExtension5 extends "Posted Purch. Invoice - Update"
    {
        layout
        {
            addafter("Payment Method Code")
            {
                field("Payment Terms Code"; Rec."Payment Terms Code")
                {
                    ApplicationArea = All;
                }
            }
        }
    }
    
    codeunit 50111 MyCodeunit5
    {
        [EventSubscriber(ObjectType::Page, Page::"Posted Purch. Invoice - Update", 'OnAfterRecordChanged', '', false, false)]
        local procedure OnAfterRecordChanged(var PurchInvHeader: Record "Purch. Inv. Header"; xPurchInvHeader: Record "Purch. Inv. Header"; var IsChanged: Boolean; xPurchInvHeaderGlobal: Record "Purch. Inv. Header");
        begin
            IsChanged := PurchInvHeader."Payment Terms Code" <> xPurchInvHeaderGlobal."Payment Terms Code";
        end;
    
        [EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch. Inv. Header - Edit", 'OnBeforePurchInvHeaderModify', '', false, false)]
        local procedure OnBeforePurchInvHeaderModify(var PurchInvHeader: Record "Purch. Inv. Header"; PurchInvHeaderRec: Record "Purch. Inv. Header");
        begin
            PurchInvHeader."Payment Terms Code" := PurchInvHeaderRec."Payment Terms Code";
        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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,556 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,028 Super User 2026 Season 1

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 877 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans