web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Customizing Boolean field

(0) ShareShare
ReportReport
Posted on by 436

Hello everyone, 

I have created a table "Item Model" along with its list and card pages. The table contains one Boolean field i.e. "Default". I want a functionality that whenever I mark Default=true for one of the item. The rest of the entries with same item no. should be automatically set to default=false and should become non-editable and when I make the entry having default=true equal to false then the rest of the entries with same item no.  become editable. In the below is the example that I want. For Item No.=1000 I want that if one default is set to true then the rest of the entries with same item no. should be set to false and become non-editable. and if I change the default from true to false then the rest of the default named fields become editable. Make sure that the process must for only those entries that have same item no. Kindly help. Thank you. 

  

I have the same question (0)
  • Verified answer
    Tech-Lucky Profile Picture
    1,288 Moderator on at

    The first part is you need to make other items with the same item No. as Default:= false for that you can use here the ModifyAll function Like the bellow

    write this code to Field "Default" OnValidate Trigger in Table
    var
    RecItemModel: Record "Item Model";

    RecItemModel .Reset();
    RecItemModel .Setrange("Item No.", Rec."Item No.");
    RecItemModel .Setfilter("Make Code",'<>%1', Rec."Make Code"); // if this is unique for other entries with the same item no otherwise this will not work try to use Primary Keys that makes the entries unique to prevent the current record to be modified
    if RecItemModel .findset then
     RecItemModel.Modifyall("Default",false);

    the editable or noneditable thing can be done with the help of Boolean variables on the Page level share your objects code if you still face issues to achieve this I will try to help you out in that as well.

    Please mark this answer verified if this was helpful.

  • Muhammad Anas Naeemi Profile Picture
    436 on at

    Thank you Tech Lucky, it worked.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,012 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 986 Super User 2026 Season 1

#3
Teagen Boll Profile Picture

Teagen Boll 659 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans