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

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,005 Super User 2025 Season 2 on at

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

    update-posted-doc.jpg

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,111 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
    95,647 Super User 2025 Season 2 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

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

#2
YUN ZHU Profile Picture

YUN ZHU 888 Super User 2025 Season 2

#3
Jainam M. Kothari Profile Picture

Jainam M. Kothari 778 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans