-
Notifications
You must be signed in to change notification settings - Fork 8
HowToCheck
carlowolter edited this page Apr 25, 2015
·
6 revisions
If you want to operate a validation check before storing data in the database, you have to:
- define a rule for the model in Delphi
rule.pasunit - 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
- Panel-Based
- [List] (List)
- [Form] (Form)
- [GridPanel] (GridPanel)
- [ChartPanel] (ChartPanel)
- [Tool Controllers] (Tool)
- [Login] (Login)
- [Logout] (Logout)
- [ChangePassword] (ChangePassword)
- Features
- Examples
- Developer's guide
- Library reference
- Frequently Asked Questions
- Kitto tips & tricks and how-tos
- Other information
- Kitto Enterprise