Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Sales Page change field editable

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 :) 

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: Sales Page change field editable

    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.

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 73,698 Super User 2024 Season 2 on at
    RE: Sales Page change field editable

    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

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans