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

I have the same question (0)
  • Suggested answer
    Lars Lohndorf-Larsen Profile Picture
    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
    607 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

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,229

#2
Jainam M. Kothari Profile Picture

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

#3
YUN ZHU Profile Picture

YUN ZHU 1,153 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans