OnBeforeValidate (Field Extension) Trigger
Version: Available or changed with runtime version 1.0.
Runs before the user input is validated.
Syntax
trigger OnBeforeValidate()
begin
...
end;
Remarks
This trigger is run before the default validation behavior is executed on a record field entry, which are default checks such as data type validation. An error message displays if an error occurs in the trigger code. In case of an error, the user entry is not written to the database.
It applies to an already existing table field when it is being modified in a table extension.
Example
tableextension 50111 "CustomerExt" extends Customer
{
fields
{
modify("Address 2")
{
trigger OnBeforeValidate()
begin
if (rec.Address = '') then
error('Please, input a first address before specifying a second one.');
end;
}
}
}
See Also
Get Started with AL
Developing Extensions
OnBeforeValidate (Page Field Extension) Trigger
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈