SlideShare a Scribd company logo
19
Copyright © 2004, Oracle. All rights reserved.
Validation
19-2 Copyright © 2004, Oracle. All rights reserved.
Objectives
After completing this lesson, you should be able to do
the following:
• Explain the effects of the validation unit upon a
form
• Control validation:
– Using object properties
– Using triggers
– Using Pluggable Java Components
• Describe how Forms tracks validation status
• Control when validation occurs
19-3 Copyright © 2004, Oracle. All rights reserved.
The Validation Process
Forms validates at the following levels:
Form level
Block level
Record level
Item level
19-4 Copyright © 2004, Oracle. All rights reserved.
The Validation Process
Validation occurs when:
• [Enter] key or ENTER Built-in is
obeyed
• Operator or trigger leaves the validation unit
(includes a Commit)
19-5 Copyright © 2004, Oracle. All rights reserved.
Controlling Validation Using Properties:
Validation Unit
19-7 Copyright © 2004, Oracle. All rights reserved.
Controlling Validation Using Properties:
Validate from List
LOV
TERRY
Full list
MART
Partial list
Valid
Auto complete
AL
ALAN
HDATE
---------------
20-FEB-1981
22-FEB-1981
06-MAR-1996
06-FEB-1995
08-SEP-1981
ENAME
---------------
MARTIN
MARTINEZ
SEDAT
WARD
ALAN
WARD
19-9 Copyright © 2004, Oracle. All rights reserved.
Controlling Validation Using Triggers
• Item level:
When-Validate-Item
• Block level:
When-Validate-Record
IF :ORDERS.order_date > SYSDATE THEN
MESSAGE(Order Date is later than today!’);
RAISE form_trigger_failure;
END IF;
19-11 Copyright © 2004, Oracle. All rights reserved.
Example: Validating User Input
Trigger failure?
When-Validate-Item
Customer ID
SELECT . . .
WHERE customer_id =
:ORDERS.customer_id
104
19-13 Copyright © 2004, Oracle. All rights reserved.
Using Client-Side Validation
• Forms
validation:
– Occurs on
middle tier
– Involves
network
traffic
• Client-side
validation:
– Improves
performance
– Implemented
with PJC
Attempt to enter alphabetic characters
Using number datatype
Using KeyFilter PJC
19-15 Copyright © 2004, Oracle. All rights reserved.
Using Client-Side Validation
To use a PJC:
1. Set the item’s Implementation Class property
2. Set properties for the PJC
SET_CUSTOM_PROPERTY('order_items.quantity',
1,'FILTER_TYPE','NUMERIC');
19-16 Copyright © 2004, Oracle. All rights reserved.
Tracking Validation Status
• NEW
– When a record is created
– Also for Copy Value from Item or Initial Value
• CHANGED
– When changed by user or trigger
– When any item in new record is changed
• VALID
– When validation has been successful
– After records are fetched from database
– After a successful post or commit
– Duplicated record inherits status of source
19-18 Copyright © 2004, Oracle. All rights reserved.
Controlling When Validation Occurs with
Built-Ins
• CLEAR_BLOCK, CLEAR_FORM, EXIT_FORM
• ENTER
• SET_FORM_PROPERTY
– (..., VALIDATION)
– (..., VALIDATION_UNIT)
• ITEM_IS_VALID item property
• VALIDATE (scope)
19-20 Copyright © 2004, Oracle. All rights reserved.
Summary
In this lesson, you should have learned that:
• The validation unit specifies how much data is
entered before validation occurs.
• You can control validation using:
– Object properties: Validation Unit (form); Validate
from List (item)
– Triggers: When-Validate-Item (item level); When-
Validate-Record (block level)
– Pluggable Java Components for client-side
validation
19-21 Copyright © 2004, Oracle. All rights reserved.
Summary
• Forms tracks validation status of items and
records, which are either NEW, CHANGED, or VALID.
• You can use built-ins to control when validation
occurs:
– CLEAR_BLOCK
– CLEAR_FORM
– EXIT_FORM
– ENTER
– ITEM_IS_VALID
– VALIDATE
19-22 Copyright © 2004, Oracle. All rights reserved.
Practice 19 Overview
This practice covers the following topics:
• Validating the Sales Representative item value by
using an LOV
• Writing a validation trigger to check that online
orders are CREDIT orders
• Populating customer names, sales representative
names, and IDs when a customer ID is changed
• Writing a validation trigger to populate the name
and the price of the product when the product ID is
changed
• Restricting user input to numeric characters using
a Pluggable Java Component

More Related Content

What's hot (10)

PPT
Les25
Sudharsan S
 
PPT
Les23
Sudharsan S
 
PPT
Oracle forms les15
Abed Othman
 
PPT
Oracle forms les01
Abed Othman
 
PDF
Oracle forms developer 10g vol1
abdull466
 
PPTX
Ioc introduction
SHIH BING-SHOU
 
PPTX
Session 43 - Spring - Part 1 - IoC DI Beans
PawanMM
 
PPTX
ILINX Export Demo
Shadrach White
 
PDF
Folio3 - An Introduction to PHP Yii
Folio3 Software
 
PPT
R12 d49656 gc10-apps dba 06
zeesniper
 
Oracle forms les15
Abed Othman
 
Oracle forms les01
Abed Othman
 
Oracle forms developer 10g vol1
abdull466
 
Ioc introduction
SHIH BING-SHOU
 
Session 43 - Spring - Part 1 - IoC DI Beans
PawanMM
 
ILINX Export Demo
Shadrach White
 
Folio3 - An Introduction to PHP Yii
Folio3 Software
 
R12 d49656 gc10-apps dba 06
zeesniper
 

Viewers also liked (20)

PPT
Oracle forms les25
Abed Othman
 
PPT
Oracle forms les11
Abed Othman
 
PPT
Oracle forms les20
Abed Othman
 
PPT
Oracle forms les12
Abed Othman
 
PPT
Oracle forms les07
Abed Othman
 
PPT
Oracle forms les10
Abed Othman
 
PPT
Oracle forms les05
Abed Othman
 
PPT
Oracle forms les013
Abed Othman
 
PPT
Oracle forms les23
Abed Othman
 
PPT
Oracle forms les03
Abed Othman
 
PPT
Oracle forms les14
Abed Othman
 
PPT
Oracle forms les08
Abed Othman
 
PPT
Oracle forms les21
Abed Othman
 
PPT
Oracle forms les17
Abed Othman
 
PPT
Oracle forms les18
Abed Othman
 
PPT
Oracle forms les22
Abed Othman
 
PPT
Oracle forms les09
Abed Othman
 
PPT
Oracle forms les24
Abed Othman
 
PPT
Oracle forms les16
Abed Othman
 
PPT
Oracle forms les04
Abed Othman
 
Oracle forms les25
Abed Othman
 
Oracle forms les11
Abed Othman
 
Oracle forms les20
Abed Othman
 
Oracle forms les12
Abed Othman
 
Oracle forms les07
Abed Othman
 
Oracle forms les10
Abed Othman
 
Oracle forms les05
Abed Othman
 
Oracle forms les013
Abed Othman
 
Oracle forms les23
Abed Othman
 
Oracle forms les03
Abed Othman
 
Oracle forms les14
Abed Othman
 
Oracle forms les08
Abed Othman
 
Oracle forms les21
Abed Othman
 
Oracle forms les17
Abed Othman
 
Oracle forms les18
Abed Othman
 
Oracle forms les22
Abed Othman
 
Oracle forms les09
Abed Othman
 
Oracle forms les24
Abed Othman
 
Oracle forms les16
Abed Othman
 
Oracle forms les04
Abed Othman
 
Ad

Similar to Oracle forms les19 (20)

PPT
Les19
Sudharsan S
 
PPT
Oracle iprocurement-101018113112-phpapp01
Kaushik Kumar Kuberanathan
 
PPT
Oracle Forms : Validation Triggers
Sekhar Byna
 
PPT
iProcurement Overview - Details Presentation
ssuser6d48be
 
PPT
L20 managing the review cycle using process management
Naresh Kumar SAHU
 
PPTX
L3 Java CAPGEMINI_1.0.pptx
TamilHunt
 
PDF
PowerTech - Part-Time Privileges: Accountability for Powerful Users
HelpSystems
 
PPTX
Internal_Requisition-Internal_Sales_Order.pptx
HidayatullaShaikh1
 
PPTX
Intro to Automation Using Perfecto's CQ Lab
Lizzy Guido (she/her)
 
PDF
Tests and Testability: Apex Structure and Strategy
Salesforce Developers
 
PDF
Workflows in WSO2 API Manager - WSO2 API Manager Community Call (12/15/2021)
WSO2
 
PDF
Nishant_Automation Engineer-CV
Nishant Shah
 
PPTX
Developing Secure IBM i Applications
HelpSystems
 
PPT
Webinar - Oracle iProcurement in Oracle Purchasing Application
iWare Logic Technologies Pvt. Ltd.
 
PPT
Gl qtp day 1 & 2
Pragya Rastogi
 
PDF
Spreadsheet management tool presentation
ivyworks
 
DOCX
Oracle Quality setup
Mina Lotfy
 
PDF
qualitysetup-220216115609.pdf
ssuserf9d4211
 
PDF
API Check Overview - Rigor Monitoring
Anthony Ferrari
 
PPT
Oracle i procurement
Pietro Prestia
 
Oracle iprocurement-101018113112-phpapp01
Kaushik Kumar Kuberanathan
 
Oracle Forms : Validation Triggers
Sekhar Byna
 
iProcurement Overview - Details Presentation
ssuser6d48be
 
L20 managing the review cycle using process management
Naresh Kumar SAHU
 
L3 Java CAPGEMINI_1.0.pptx
TamilHunt
 
PowerTech - Part-Time Privileges: Accountability for Powerful Users
HelpSystems
 
Internal_Requisition-Internal_Sales_Order.pptx
HidayatullaShaikh1
 
Intro to Automation Using Perfecto's CQ Lab
Lizzy Guido (she/her)
 
Tests and Testability: Apex Structure and Strategy
Salesforce Developers
 
Workflows in WSO2 API Manager - WSO2 API Manager Community Call (12/15/2021)
WSO2
 
Nishant_Automation Engineer-CV
Nishant Shah
 
Developing Secure IBM i Applications
HelpSystems
 
Webinar - Oracle iProcurement in Oracle Purchasing Application
iWare Logic Technologies Pvt. Ltd.
 
Gl qtp day 1 & 2
Pragya Rastogi
 
Spreadsheet management tool presentation
ivyworks
 
Oracle Quality setup
Mina Lotfy
 
qualitysetup-220216115609.pdf
ssuserf9d4211
 
API Check Overview - Rigor Monitoring
Anthony Ferrari
 
Oracle i procurement
Pietro Prestia
 
Ad

Oracle forms les19

  • 1. 19 Copyright © 2004, Oracle. All rights reserved. Validation
  • 2. 19-2 Copyright © 2004, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to do the following: • Explain the effects of the validation unit upon a form • Control validation: – Using object properties – Using triggers – Using Pluggable Java Components • Describe how Forms tracks validation status • Control when validation occurs
  • 3. 19-3 Copyright © 2004, Oracle. All rights reserved. The Validation Process Forms validates at the following levels: Form level Block level Record level Item level
  • 4. 19-4 Copyright © 2004, Oracle. All rights reserved. The Validation Process Validation occurs when: • [Enter] key or ENTER Built-in is obeyed • Operator or trigger leaves the validation unit (includes a Commit)
  • 5. 19-5 Copyright © 2004, Oracle. All rights reserved. Controlling Validation Using Properties: Validation Unit
  • 6. 19-7 Copyright © 2004, Oracle. All rights reserved. Controlling Validation Using Properties: Validate from List LOV TERRY Full list MART Partial list Valid Auto complete AL ALAN HDATE --------------- 20-FEB-1981 22-FEB-1981 06-MAR-1996 06-FEB-1995 08-SEP-1981 ENAME --------------- MARTIN MARTINEZ SEDAT WARD ALAN WARD
  • 7. 19-9 Copyright © 2004, Oracle. All rights reserved. Controlling Validation Using Triggers • Item level: When-Validate-Item • Block level: When-Validate-Record IF :ORDERS.order_date > SYSDATE THEN MESSAGE(Order Date is later than today!’); RAISE form_trigger_failure; END IF;
  • 8. 19-11 Copyright © 2004, Oracle. All rights reserved. Example: Validating User Input Trigger failure? When-Validate-Item Customer ID SELECT . . . WHERE customer_id = :ORDERS.customer_id 104
  • 9. 19-13 Copyright © 2004, Oracle. All rights reserved. Using Client-Side Validation • Forms validation: – Occurs on middle tier – Involves network traffic • Client-side validation: – Improves performance – Implemented with PJC Attempt to enter alphabetic characters Using number datatype Using KeyFilter PJC
  • 10. 19-15 Copyright © 2004, Oracle. All rights reserved. Using Client-Side Validation To use a PJC: 1. Set the item’s Implementation Class property 2. Set properties for the PJC SET_CUSTOM_PROPERTY('order_items.quantity', 1,'FILTER_TYPE','NUMERIC');
  • 11. 19-16 Copyright © 2004, Oracle. All rights reserved. Tracking Validation Status • NEW – When a record is created – Also for Copy Value from Item or Initial Value • CHANGED – When changed by user or trigger – When any item in new record is changed • VALID – When validation has been successful – After records are fetched from database – After a successful post or commit – Duplicated record inherits status of source
  • 12. 19-18 Copyright © 2004, Oracle. All rights reserved. Controlling When Validation Occurs with Built-Ins • CLEAR_BLOCK, CLEAR_FORM, EXIT_FORM • ENTER • SET_FORM_PROPERTY – (..., VALIDATION) – (..., VALIDATION_UNIT) • ITEM_IS_VALID item property • VALIDATE (scope)
  • 13. 19-20 Copyright © 2004, Oracle. All rights reserved. Summary In this lesson, you should have learned that: • The validation unit specifies how much data is entered before validation occurs. • You can control validation using: – Object properties: Validation Unit (form); Validate from List (item) – Triggers: When-Validate-Item (item level); When- Validate-Record (block level) – Pluggable Java Components for client-side validation
  • 14. 19-21 Copyright © 2004, Oracle. All rights reserved. Summary • Forms tracks validation status of items and records, which are either NEW, CHANGED, or VALID. • You can use built-ins to control when validation occurs: – CLEAR_BLOCK – CLEAR_FORM – EXIT_FORM – ENTER – ITEM_IS_VALID – VALIDATE
  • 15. 19-22 Copyright © 2004, Oracle. All rights reserved. Practice 19 Overview This practice covers the following topics: • Validating the Sales Representative item value by using an LOV • Writing a validation trigger to check that online orders are CREDIT orders • Populating customer names, sales representative names, and IDs when a customer ID is changed • Writing a validation trigger to populate the name and the price of the product when the product ID is changed • Restricting user input to numeric characters using a Pluggable Java Component

Editor's Notes

  • #3: Introduction Overview In this lesson, you will learn how to supplement item validation by using both object properties and triggers. You will also learn to control when validation occurs.
  • #4: Validation Process Validation Levels Forms performs a validation process at several levels to ensure that records and individual values follow appropriate rules. If validation fails, then control is passed back to the appropriate level, so that the operator can make corrections. Validation occurs at: Item level: Forms records a status for each item to determine whether it is currently valid. If an item has been changed and is not yet marked as valid, then Forms first performs standard validation checks to ensure that the value conforms to the item’s properties. These checks are carried out before firing any When-Validate-Item triggers that you have defined. Standard checks include the following: Format mask Required (if so, then is the item null?) Data type Range (Lowest-Highest Allowed Value) Validate from List (see later in this lesson)
  • #5: Validation Process (continued) Record level: After leaving a record, Forms checks to see whether the record is valid. If not, then the status of each item in the record is checked, and a When-Validate-Record trigger is then fired, if present. When the record passes these checks, it is set to valid. Block and form level: At block or form level, all records below that level are validated. For example, if you commit (save) changes in the form, then all records in the form are validated, unless you have suppressed this action. When does Validation Occur? Forms carries out validation for the validation unit under the following conditions: The [Enter] key is pressed or the ENTER built-in procedure is run. The purpose of the ENTER built-in is to force validation immediately.Note: The ENTER action is not necessarily mapped to the key that is physically labeled Enter. The operator or a trigger navigates out of the validation unit. This includes when changes are committed. The default validation unit is item, but can also be set to record, block, or form by the designer. The validation unit is discussed in the next section.
  • #6: Using Object Properties to Control Validation You can control when and how validation occurs in a form, even without triggers. Do this by setting properties for the form and for individual items within it. The Validation Unit The validation unit defines the maximum amount of data an operator can enter in the form before Forms initiates validation. Validation unit is a property of the form module, and it can be set in the Property Palette to any of the following: Default Item Record Block Form The default setting is item level. The default setting is usually chosen. In practice, an item-level validation unit means that Forms validates changes when an operator navigates out of a changed item. This way, standard validation checks and firing the When-Validate-Item trigger of that item can be done immediately. As a result, operators are aware of validation failure as soon as they attempt to leave the item.
  • #7: Using Object Properties to Control Validation (continued) At higher validation units (record, block, or form level), the above checks are postponed until navigation moves out of that unit. All outstanding items and records are validated together, including the firing of When-Validate-Item and When-Validate-Record triggers. You might set a validation unit above item level under one of the following conditions: Validation involves database references, and you want to postpone traffic until the operator has completed a record (record level). The application runs on the Internet and you want to improve performance by reducing round trips to the application server.
  • #8: Using LOVs for Validation When you attach an LOV to a text item by setting the LOV property of the item, you can optionally use the LOV contents to validate data entered in the item. The Validate from List Property Do this by setting the Validate from List property to Yes for the item. At validation time, Forms then automatically uses the item value as a non case-sensitive search string on the LOV contents. The following events then occur, depending on the circumstances: If the value in the text item matches one of the values in the first column of the LOV, validation succeeds, the LOV is not displayed, and processing continues normally. If the item’s value causes a single record to be found in the LOV, but is a partial value of the LOV value, then the full LOV column value is returned to the item (providing that the item is defined as the return item in the LOV). The item then passes this validation phase. If the item value causes multiple records to be found in the LOV, Forms displays the LOV and uses the text item value as the search criteria to automatically reduce the list, so that the operator must choose. If no match is found, then the full LOV contents are displayed to the operator.
  • #9: Using LOVs for Validation (continued) Note: Make sure that LOVs you create for validation purposes have the validation column defined first, with a display width greater than 0. You also need to define the Return Item for the LOV column as the item being validated. For performance reasons, do not use the LOV for Validation property for large LOVs.
  • #10: Controlling Validation by Using Triggers There are triggers that fire due to validation, which let you add your own customized actions. There are also some built-in subprograms that you can call from triggers that affect validation. When-Validate-Item Trigger You have already used this trigger to add item-level validation. The trigger fires after standard item validation, and input focus is returned to the item if the trigger fails. Example The When-Validate-Item trigger on ORDERS.Order_Date, shown above, ensures that the Order Date is not later than the current (database) date.
  • #11: Controlling Validation by Using Triggers (continued) When-Validate-Record Trigger This trigger fires after standard record-level validation, when the operator has left a new or changed record. Because Forms has already checked that required items for the record are valid, you can use this trigger to perform additional checks that may involve more than one of the record’s items, in the order they were entered. When-Validate-Record must be defined at block level or above. Example This When-Validate-Record trigger on block ORDER_ITEMS warns the operator when a line item for a new credit order causes the customer’s credit limit to be exceeded. DECLARE cred_limit number; n number; BEGIN -- Order status of 4 is new credit order IF :orders.order_status = 4 THEN SELECT credit_limit INTO cred_limit FROM customers WHERE customer_id = :orders.customer_id; IF :control.total > cred_limit THEN n := show_alert('credit_limit_alert'); END IF; END IF; END; Note: If you want to stop the operator from navigating out of the item when validation fails, you can raise an exception to fail the trigger: RAISE form_trigger_failure; In the example above, you would include this code immediately after displaying the alert.
  • #12: Controlling Validation by Using Triggers (continued) Example: Validating user input While populating other items, if the user enters an invalid value in the item, a matching row will not be found, and the SELECT statement will cause an exception. The success or failure of the query can, therefore, be used to validate user input. The exceptions that can occur when a single row is not returned from a SELECT in a trigger are: NO_DATA_FOUND: No rows are returned from the query. TOO_MANY_ROWS: More than one row is returned from the query. Example The following When-Validate-Item trigger is again placed on the Customer_ID item, and returns the Name that correspond to the Customer ID entered by the user. SELECT cust_first_name || ‘ ‘ || cust_last_nameINTO :ORDERS.customer_nameFROM customers WHERE customer_id = :ORDERS.customer_id;
  • #13: Controlling Validation by Using Triggers (continued) Example: Validating user input (continued) If the Customer_ID item contains a value that is not found in the table, the NO_DATA_FOUND exception is raised, and the trigger will fail because there is no exception handler to prevent the exception from propagating to the end of the trigger. Note: A failing When-Validate-Item trigger prevents the cursor from leaving the item. For an unhandled exception, as above, the user receives the message: FRM-40735: <trigger type> trigger raised unhandled exception <exception>
  • #14: Using Client-Side Validation It is common practice to process input to an item using a When-Validate-Item trigger. The trigger itself is processed on the Forms Services. Even validation that occurs with a format mask on an item involves a trip to the middle tier. In the first example in the slide, the number data type on the Quantity item is not checked until the operator presses [Enter] to send the input to the Forms Services machine, which returns the FRM-50016 error. You should consider using Pluggable Java Components (PJCs) to replace the default functionality of standard client items, such as text boxes. Then validation of items, such as the date or maximum or minimum values, is contained within an item. This technique opens up opportunities for more complex, application-specific validation, like automatic formatting of input such as telephone numbers with format (XXX) XXX-XXXX. Even a simple numeric format is enforced instantly, not allowing alphabetic keystrokes to be entered into the item. This validation is performed on the client without involving a network round trip, thus improving performance. In the second example above, the KeyFilter PJC does not allow the operator to enter an alphabetic character into the Quantity item. The only message that is displayed on the message line is the item’s Hint.
  • #15: Using Client-Side Validation (continued) Pluggable Java Components are similar to JavaBeans, and in fact, the two terms are often used interchangeably. Although both are Java components that you can use in a form, there are the following differences between them: JavaBeans are implemented in a bean area item, whereas PJCs are implemented in a native Forms item such as a text item or check box. PJCs must always have the implementation class specified in the Property Palette, but JavaBeans may be registered at run time with the FBean package.
  • #16: Using Client-Side Validation (continued) You implement a PJC to replace an item by setting the item’s Implementation Class property to the class of the PJC. You may use the SET_CUSTOM_PROPERTY built-in to set properties of the PJC that restrict input or otherwise validate the item. At run time, Forms looks for the Java class contained on the middle tier or in the archive files with the path specified in the Implementation Class for the item. If you open keyfilter.jar in WinZip, you find that the path to KeyFilter.class is oracle\forms\demos. You deploy the PJC as you would a JavaBean, which was discussed in Lesson 16. You can locate the Java class file: On the middle-tier server, either in the directory structure referenced by the form applet’s CODEBASE parameter or in the server’s CLASSPATH. CODEBASE is by default the forms90\java subdirectory of ORACLE_HOME. If using JInitiator, in a JAR file in the middle-tier server’s CODEBASE directory, and included in the ARCHIVE parameter so that the JAR file is downloaded to and cached on the client. For example: archive_jini=f90all_jinit.jar,keyfilter.jar (The CODEBASE and ARCHIVE parameters are set in the formsweb.cfg file.)
  • #17: Tracking Validation Status When Forms leaves an object, it usually validates any changes that were made to the contents of the object. To determine whether validation must be performed, Forms tracks the validation status of items and records.
  • #18: Tracking Validation Status (continued) Item Validation Status Record Validation Status
  • #19: Controlling When Validation Occurs with Built-Ins You can use the following built-in subprograms in triggers to affect validation. CLEAR_BLOCK, CLEAR_FORM, and EXIT_FORM The first parameter to these built-ins, COMMIT_MODE, controls what will be done with unapplied changes when a block is cleared, the form is cleared, or the form is exited respectively. When the parameter is set to NO_VALIDATE, changes are neither validated nor committed (by default, the operator is prompted for the action). ITEM_IS_VALID Item Property You can use GET_ITEM_PROPERTY and SET_ITEM_PROPERTY built-ins with the ITEM_IS_VALID parameter to get or set the validation status of an item. You cannot directly get and set the validation status of a record. However, you can get or set the validation status of all the items in a record. ENTER The ENTER built-in performs the same action as the [Enter] key. That is, it forces validation of data in the current validation unit.
  • #20: Controlling When Validation Occurs with Built-Ins (continued) SET_FORM_PROPERTY You can use this to disable Forms validation. For example, suppose you are testing a form, and you need to bypass normal validation. Set the Validation property to Property_False for this purpose: SET_FORM_PROPERTY(’form_name’,VALIDATION, PROPERTY_FALSE); You can also use this built-in to change the validation unit programmatically: SET_FORM_PROPERTY(’form_name’,VALIDATION_UNIT, scope); VALIDATE VALIDATE(scope)forces Forms to immediately execute validation processing for the indicated scope. Note: Scope is one of DEFAULT_SCOPE, BLOCK_SCOPE, RECORD_SCOPE, or ITEM_SCOPE.
  • #21: Summary In this lesson, you learned to use additional validation features in Forms Builder, and to control when validation occurs. Validation occurs at several levels: Item, Record, Block, and Form. Validation happens when: The [Enter] Key is pressed or the ENTER built-in procedure is run (to force validation immediately.) Control leaves the validation unit due to navigation or Commit. Standard validation occurs before trigger validation. The Default validation unit is item level. The When-Validate-“object” triggers supplement standard validation. You can use Pluggable Java Components to perform client-side validation.
  • #22: Summary (continued) Forms tracks validation status internally: NEW, CHANGED, or VALID You can use built-ins to control when validation occurs.
  • #23: Practice 19 Overview In this practice, you introduce additional validation to the CUSTGXX and ORDGXX form modules. Validating sales representative item value by using an LOV Writing a validation trigger to check that all online orders are CREDIT orders Populating customer names, sales representative names, and IDs when a customer ID is changed Writing a validation trigger to populate the name and the price of the product when the product ID is changed Implementing client-side validation on the item quantity using a Pluggable Java Component Note: For solutions to this practice, see Practice 19 in Appendix A, “Practice Solutions.”
  • #24: Practice 19 1.In the CUSTGXX form, cause the Account_Mgr_Lov to be displayed whenever the user enters an Account_Mgr_Id that does not exist in the database. 2.Save and compile the form. Click Run Form to run the form and test the functionality. 3.In the ORDGXX form, write a validation trigger to check that if the Order_Mode is online, the Order_Status indicates a CREDIT order (values between 4 and 10). You can import the text from pr19_3.txt. 4.In the ORDGXX form, create a trigger to write the correct values to the Customer_Name, Sales_Rep_Name, and Sales_Rep_Id items whenever validation occurs on Customer_Id. Fail the trigger if the data is not found. You can import text from pr19_4a.txt and pr19_4b.txt. 5.Create another validation trigger on ORDER_ITEMS.Product_Id to derive the name of the product and suggested wholesale price, and write them to the Description item and the Price item. Fail the trigger and display a message if the product is not found. You can import the text from pr19_5.txt. 6.Perform client-side validation on the ORDER_ITEMS.Quantity item using a Pluggable Java Component to filter the keystrokes and allow only numeric values. The full path to the PJC class is oracle.forms.demos.KeyFilter (this is case sensitive), to be used as the Implementation Class for the item. You will set the filter for the item in the next practice, so the validation is not yet functional. 7.Save and compile the form. Click Run Form to run the form and test the changes. Do not test the validation on the Quantity item because it will not function until after you set the filter on the item in Practice 20.