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

Sales Page change field editable

(0) ShareShare
ReportReport
Posted on by 30

Hello Guys.

I'm struggling with a job, where i need to change a field property "Editable"...

I have a value in the "Sales Header" table - when that changes from '' to anything, i wanna trigger the property change, so the fields after that gets locked for editable... 

I really can't figure out how, as i see it i can only change field properties in the Page Extension - but here i can't figure out how to trigger it when another field value changes...

Please heeelp :) 

I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    95,634 Super User 2025 Season 2 on at

    Hi, hope the following helps.

    The page mode that the page was opened in (Editable of the page):

    https://yzhums.com/9132/

    Switching a page to non-editable in real time via a field value:

    https://yzhums.com/16756/

    Thanks.

    ZHU

  • Suggested answer
    Nitin Verma Profile Picture
    21,708 Moderator on at

    Hi RasmusAKEA,

    To achieve this you have to use OnafterGetCurrRecord trigger of that page, you can do the following

    pageextension 66003 "ModifySO" extends "Sales Order" //42

    {

       layout

       {

           modify("Sell-to Phone No.")

           {

               trigger OnAfterValidate()

               begin

                   CurrPage.Update();

               end;

           }

           modify("External Document No.")

           {

               Editable = ControlEditable;

           }

       }

       trigger OnAfterGetCurrRecord()

       begin

           ControlEditable := rec."Sell-to Phone No." = '';

       end;

       var

           ControlEditable: Boolean;

    }

    Here you can replace your own fields for Phone No. and external document no.

    Let me know if that you are looking for

    Thanks.

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

#2
Jainam M. Kothari Profile Picture

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

#3
YUN ZHU Profile Picture

YUN ZHU 948 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans