View the Exhibit.
You have placed the following code in a Post insert trigger on the Orders block:
SELECT orders_seq.NEXTVAL
INTO :orders.order_id
FORM SYS.dual;
You have also set Item properties for the Order_Id Item in the form so that users cannot directly enter an Order ID.
As the SUMMIT user, you run the form to test it. Yon are able to insert a record in the block, but when you click Save, you have a database error as shown in the Exhibit.
What is the probable cause of this error?
Yon have created a list item for the Credit__Rating field in the Customers form, the Finance department usually determines a range of scores that pertain to the customer, the values in the list are Excellent, Good, Fair, and Poor, corresponding to the ranges provided by Finance. The default value Fair, because that is the range that applies to most customers.
Sometimes, Finance can provide an exact credit score; so users must be able to enter the exact numerical value if it is known. Often clerks enter the customer data before the performance of a credit check, so they must be able to enter a blank value if the credit rating is not yet determined.
Users want to be able to select a blank value from the list, but the list does not display a blank line for them to select. How can you meet this requirement without changing the default value of the list item?
You have written a When-Validate-Item trigger. You want this trigger to fire even if the form is in Enter-Query mode. What must you do to achieve this?
Coding Triggers for Enter-Query Mode
Some triggers that fire when the form is in Normal mode (during data entry and saving) may also be fired in Enter-Query mode. You need to consider the trigger type and actions in these cases.
''Fire in Enter-Query Mode''Property
To create a trigger that fires in Enter-Query mode, in its Property Palette set the ''Fire in Enter-Query Mode''property to Yes. This property determines whether Forms fires a trigger if the associated event occurs in Enter-Query mode. Not all triggers can do this. See last line in note below.
By default, the ''Fire in Enter-Query Mode''property is set to Yes for triggers that accept this. Set it to No in the Property Palette if you want the trigger to fire only in Normal mode.
Note:
The following triggers may fire in Enter-Query mode:
*Key-
* On-Error
* On-Message
* When-triggers,
except:
-When-Database-Record
-When-Image-Activated
-When-New-Block-Instance
-When-New-Form-Instance
-When-Create-Record
-When-Remove-Record
-When-Validate-Record
-When-Validate-Item
View the Exhibit.
The Departments table in the database contains four columns. In a new form, you use the Data Block Wizard to add all columns to the block, but in the layout Wizard, you choose all columns except Location_Id to add to the canvas. The Object Navigator and layout Editor appear as shown in the Exhibit.
You then decide that you do need to display Location_Id on the canvas. What object must you select before invoking the Layout Editor in re-entrant mode to make this change?
You have a form that called a database stored procedure. You do not want processing to continue, so immediately after the call to the stored procedure, you add the following code:
IF NOT FORM_SUCCESS THEN
MESSAGE ('Stored Procedure failure');
RAISE FORM_TRIGGER_FAILURE;
END IF;
You test the code and input some data that intentionally causes the stored procedure to fail. However, the message that you defined does not appear. What are two possible reasons for this?
A: You should use DBMS_ERROR_CODE and DBMS_ERROR_TEXT in an ON-ERROR trigger to trap errors propagated from Oracle server from Forms.
Note: FORM_SUCCESS and FORM_TRIGGER_FAILURE
Either the FORM_SUCCESS built-in or the FORM_TRIGGER_FAILURE exception must be used to handle all Forms errors. FORM_SUCCESS is a Boolean function that evaluates to TRUE or FALSE depending on the success or failure of a Forms built-in. FORM_TRIGGER_FAILURE is an exception that has to be raised to stop further processing whenever an error occurs or FORM_SUCCESS evaluates to FALSE. The following sections describe their use in error-message handling.