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

how to make a specific row on a page non-editable based on a condition?

(0) ShareShare
ReportReport
Posted on by 607

Hi All,

I have a requirement to make a specific row non-editable on a page based on  a condition.

This is Edit Dimension Set Entries page, if there a record on this page whose Dimension Code =  Project,then i want that specific row un-editable, rest of the rows should remain editable.

pastedimage1583486402888v1.png

Is it possbile via code?

Thanks in Advance

  • AXBOY Profile Picture
    607 on at
    RE: how to make a specific row on a page non-editable based on a condition?

    Thanks , i  got through this :

    pageextension X00XX WfsEditDimensionSetEntriesExt extends "Edit Dimension Set Entries"

    {

       layout

       {

           modify("Dimension Code")

           {

               Editable = editable;

           }

           modify(DimensionValueCode)

           {

               Editable = editable;

           }

       }

       actions

       {

           // Add changes to page actions here

       }

       trigger OnOpenPage()

       var

           salesHeader: Record "Sales Header";

       begin

           if ProjectLinks.getDocumentType() = Format(salesHeader."Document Type"::Order) then

               checkToEdit := true

           else

               checkToEdit := false;

       end;

       trigger OnAfterGetCurrRecord()

       var

           myInt: Integer;

           dimCode: Code[20];

       begin

           if checkToEdit = true then begin

               dimCode := 'PROJECT';

               if Rec."Dimension Code" = dimCode then

                   editable := false

               else

                   editable := true;

           end

           else

               editable := true;

       end;

       var

           editable: Boolean;

           checkToEdit: Boolean;

          ProjectLinks: Codeunit WfsProjectLinks;

    }

  • Suggested answer
    Lars Lohndorf-Larsen Profile Picture
    on at
    RE: how to make a specific row on a page non-editable based on a condition?

    Hi,

    You cannot make the whole row uneditable or at least I could not see any ways to do that. You can of course enforce a business rule on the OnModify trigger, or you can make individual (or all) columns undeditable by setting their Editable property = IsEditable (a new Bool variable), and then set this on OnAfterGetRecord trigger:

    OnAfterGetRecord()

    IF Code <> 'HOME' THEN

     IsEditable := TRUE

    ELSE

     IsEditable := FALSE;

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

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

#1
YUN ZHU Profile Picture

YUN ZHU 628 Super User 2025 Season 1

#2
Mansi Soni Profile Picture

Mansi Soni 495

#3
Sagar Dangar, MCP Profile Picture

Sagar Dangar, MCP 395

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans