-
Notifications
You must be signed in to change notification settings - Fork 36
HowToCheck
Carlo Barazzetta edited this page Jan 27, 2017
·
1 revision
If you want to operate a validation check before storing data in the database, you have to:
- declare and write a rule for the model in Delphi
rule.pas
unit - define the node
Rules:
for the model
example form HelloKitto:
# rule.pas
type
TCheckDuplicateInvitations = class(TKRuleImpl)
public
procedure BeforeAdd(const ARecord: TKRecord); override;
end;
procedure TCheckDuplicateInvitations.BeforeAdd(const ARecord: TKRecord);
begin
if ARecord.Store.Count('INVITEE_ID', ARecord.FieldByName('INVITEE_ID').Value) > 1 then
RaiseError(_('Cannot invite the same girl twice.'));
end;
# model Invitation.yaml
ModelName: Invitation
Fields:
.....
Rules:
CheckDuplicateInvitations:
- Kitto at a glance
- Getting started
- Setup
-
Basic concepts
- Basic Materials
- Controllers
- Features
- Kitto Enterprise
- Examples
- Developer's guide
- Library reference
- Frequently Asked Questions
- Kitto tips & tricks and how-tos
- Other information