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...
Answered

How to make a field non editable based on a condition(boolean field)

(0) ShareShare
ReportReport
Posted on by 35

how to make field 'quantity' to non editable in sales line for child item after exploding bom?

i have added  a boolean field in assembly bom page and set to true so when it is set to true and this parent item is set Explode BOM then the child item qty should be non editable? is it possible?

i have tried with an event subscriber but editable property is available ?

 any idea? is it possible?

I have the same question (0)
  • RahulKrishna Profile Picture
    35 on at

    Help!

  • Verified answer
    Shathika Karunaratne Profile Picture
    on at

    Hi,

    Yes you can do it in a simple way. 

    In below I am setting the editable field in Currency Code in Customer Page. You need a global variable EditableCurrCode. and then put it to the OnOpenPage and OnAfterGetRecord Triggers to check simply the Customer Posting Group is Local or not. If it is Local, the Currency Code field cannot be edited.

    Hope you got the method from this easy example.

            modify("Currency Code")
            {
                Editable = EditableCurrCode;
            }
        }

        trigger OnOpenPage()
        begin
            if Rec."Customer Posting Group" = 'Local' then
                EditableCurrCode := false
            else
                EditableCurrCode := true;
        end;

        trigger OnAfterGetRecord()
        begin
            if Rec."Customer Posting Group" = 'Local' then
                EditableCurrCode := false
            else
                EditableCurrCode := true;
        end;

        var
            EditableCurrCode: Boolean;
    Thanks.
    Please verify this answer if it helps you
  • Suggested answer
    Nitin Verma Profile Picture
    21,708 Moderator on at

    Hi,

    you can use InDataSet property with your Variable.

    learn.microsoft.com/.../devenv-indataset-attribute

  • RahulKrishna Profile Picture
    35 on at

    thank you! it was helpful,

  • Suggested answer
    YUN ZHU Profile Picture
    95,595 Super User 2025 Season 2 on at

    Hi, just adding some info.

    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/

    Dynamic Visibility of Controls (Hide and show fields dynamically)

    https://yzhums.com/14752/

    Hope these give you some new hints too.

    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 3,010

#2
Jainam M. Kothari Profile Picture

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

#3
YUN ZHU Profile Picture

YUN ZHU 1,085 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans