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

Field not disabled after OnValidate

(0) ShareShare
ReportReport
Posted on by

The field amount isn't disabled when ones changes/edits the amount.

Below is my code

I have put this code too.

var

[InDataSet]

FieldEditable: Boolean;

field(6; "Amount"; Decimal)
{

Caption = 'Amount';
NotBlank = true;

trigger OnValidate()
var
myInt: Integer;
begin

If rec."Rec.Amount" <> 0 then
FieldEditable := false;
end;

}

Kindly assist.

I have the same question (0)
  • Suggested answer
    JAngle Profile Picture
    150 on at

    Given the code snippet you seem to be doing this at table level. I think it works at page level: docs.microsoft.com/.../devenv-editable-property

  • Suggested answer
    Jack Davies Profile Picture
    120 on at

    As well as needing to be on the page level you will need to flag the field (in the page) to have the Editable = FieldEditable; property so that the FieldEditable variable controls the editable status of your field

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,033 Super User 2026 Season 1

#2
Dhiren Nagar Profile Picture

Dhiren Nagar 1,105 Super User 2026 Season 1

#3
YUN ZHU Profile Picture

YUN ZHU 1,035 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans