Skip to main content
Post a question

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id : 4vjAWiwg5zU9KlmZv8ZfsA
Small and medium business | Business Central, N...
Answered

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

Like (0) ShareShare
ReportReport
Posted on 23 Nov 2022 08:09:09 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?

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 78,280 Super User 2025 Season 1 on 24 Nov 2022 at 00:42:55
    RE: How to make a field non editable based on a condition(boolean field)

    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

  • RahulKrishna Profile Picture
    RahulKrishna 35 on 23 Nov 2022 at 17:33:44
    RE: How to make a field non editable based on a condition(boolean field)

    thank you! it was helpful,

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,341 Moderator on 23 Nov 2022 at 15:10:58
    RE: How to make a field non editable based on a condition(boolean field)

    Hi,

    you can use InDataSet property with your Variable.

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

  • Verified answer
    Shathika Karunaratne Profile Picture
    Shathika Karunaratne on 23 Nov 2022 at 11:24:07
    RE: How to make a field non editable based on a condition(boolean field)

    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
  • RahulKrishna Profile Picture
    RahulKrishna 35 on 23 Nov 2022 at 11:07:43
    RE: How to make a field non editable based on a condition(boolean field)

    Help!

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,608 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,558 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans