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...
Suggested Answer

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

(0) ShareShare
ReportReport
Posted on by 625

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

I have the same question (0)
  • Suggested answer
    Lars Lohndorf-Larsen Profile Picture
    Microsoft Employee on at

    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;

  • AXBOY Profile Picture
    625 on at

    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;

    }

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 1,865 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,098 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 898

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans