You are on page 1of 20

Arab Academy for Science and Technology and Maritime Transport

College of Computing and Information Technology


AAST : CSP : Oracle Courses : Developer

Oracle Developer
14. Form Builder validations

AzzaShoukr
Arab Academy for Science and Technology and Maritime Transport
College of Computing and Information Technology
AAST : CSP : Oracle Courses : Developer
14. Form Builder validations

Lab Content

- Form Builder Variables


- What is validations
- Validation types
- Validation Examples :
Validations using System Variables
Validations using form builder item properties
Validations using Parameters
Validations using screen items
Validations Using Global Variables
- Navigations

AzzaShoukr
Arab Academy for Science and Technology and Maritime Transport
College of Computing and Information Technology
AAST : CSP : Oracle Courses : Developer
14. Form Builder validations

Form Builder Variables


1. Screen Items : ( items listed under the item node in any block )
Syntax  :Block_name.item_name
2. Parameter : owned by certain form create parameter from parameter node
Syntax  :parameter.parameter_name
3. System Variables : owned by oracle form runtime session , we can read system variables values
Syntax  :system.variable_name
4. Global variables : owned by session runtime , we use global variables to transfer values among opened forms
Syntax  :global.variable_name
5.Local variable : any variable declared within block ( between declare – begin for any block )
can be used with-in this block only

AzzaShoukr
Arab Academy for Science and Technology and Maritime Transport
College of Computing and Information Technology
AAST : CSP : Oracle Courses : Developer
14. Form Builder validations

What is validation ?
How to ensure that the item value is accepted ( pass all conditions applied to this item )
Validation Types :

1. Form Builder Validation 2. Database Validations


---------------------------------------- -------------------------------
1.1 Item Properties 2.1 Constraints validation
- Required Primary key validation
- Lowest allowed value , Highest allowed value Foreign key Validation
- Data type , format mask not null validation
1.2 Using Triggers Check constraint validations ( sal >0 )
when-validate-item payment_type in ( cash , credit )
when-validate-record Unique Constraint ( no duplication )
2.2 Database Triggers
insert , update , delete triggers can be used for validation

AzzaShoukr
Arab Academy for Science and Technology and Maritime Transport
College of Computing and Information Technology
AAST : CSP : Oracle Courses : Developer
14. Form Builder validations

When does validation happen ?


Validation happens with enter key , save action

Validation Sequence
1. Form Builder validation
1. Item Properties
2. Form builder triggers

2. Database Validations

AzzaShoukr
Arab Academy for Science and Technology and Maritime Transport
College of Computing and Information Technology
AAST : CSP : Oracle Courses : Developer
14. Form Builder validations

Validations Using System Variables

System variables : group of variables for each form owned by oracle forms runtime

We can read system variables values in our coding

AzzaShoukr
Arab Academy for Science and Technology and Maritime Transport
College of Computing and Information Technology
AAST : CSP : Oracle Courses : Developer
14. Form Builder validations

Validations Using System Variables


Example :

AzzaShoukr
Arab Academy for Science and Technology and Maritime Transport
College of Computing and Information Technology
AAST : CSP : Oracle Courses : Developer
14. Form Builder validations

Validations Using Parameters

When-validate-item

Item:hiredate

Alert

AzzaShoukr
Arab Academy for Science and Technology and Maritime Transport
College of Computing and Information Technology
AAST : CSP : Oracle Courses : Developer
14. Form Builder validations

Validations Using Parameters

AzzaShoukr
Arab Academy for Science and Technology and Maritime Transport
College of Computing and Information Technology
AAST : CSP : Oracle Courses : Developer
14. Form Builder validations

Validations Using Parameters

AzzaShoukr
Arab Academy for Science and Technology and Maritime Transport
College of Computing and Information Technology
AAST : CSP : Oracle Courses : Developer
14. Form Builder validations

Screen Items : When-Validate- Record


Used when your code check the value of more than one item

AzzaShoukr
Arab Academy for Science and Technology and Maritime Transport
College of Computing and Information Technology
AAST : CSP : Oracle Courses : Developer
14. Form Builder validations

Screen Items : When-Validate-Record


Used when your code check the value of more than one item

Syntax :

:Block_name.Item_name

AzzaShoukr
Arab Academy for Science and Technology and Maritime Transport
College of Computing and Information Technology
AAST : CSP : Oracle Courses : Developer
14. Form Builder validations

Screen Items : When-Validate-Record


Used when your code check the value of more than one item

AzzaShoukr
Arab Academy for Science and Technology and Maritime Transport
College of Computing and Information Technology
AAST : CSP : Oracle Courses : Developer
14. Form Builder validations

Global Variables

AzzaShoukr
Arab Academy for Science and Technology and Maritime Transport
College of Computing and Information Technology
AAST : CSP : Oracle Courses : Developer
14. Form Builder validations

Global Variables

AzzaShoukr
Arab Academy for Science and Technology and Maritime Transport
College of Computing and Information Technology
AAST : CSP : Oracle Courses : Developer
14. Form Builder validations

Global Variables

AzzaShoukr
Arab Academy for Science and Technology and Maritime Transport
College of Computing and Information Technology
AAST : CSP : Oracle Courses : Developer
14. Form Builder validations

Global Variables

AzzaShoukr
Arab Academy for Science and Technology and Maritime Transport
College of Computing and Information Technology
AAST : CSP : Oracle Courses : Developer
14. Form Builder validations

Global Variables

AzzaShoukr
Arab Academy for Science and Technology and Maritime Transport
College of Computing and Information Technology
AAST : CSP : Oracle Courses : Developer
14. Form Builder validations

Global Variables

AzzaShoukr
Arab Academy for Science and Technology and Maritime Transport
College of Computing and Information Technology
AAST : CSP : Oracle Courses : Developer
14. Form Builder validations

Global Variables

AzzaShoukr

You might also like