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

Notifications

Announcements

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

  • Suggested answer
    JAngle Profile Picture
    137 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

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

News and Announcements

Season of Giving Solutions is Here!

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 1,572

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 789 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 693 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans