Questions for the 1Z0-151 were updated on : Nov 29 ,2024
The Credit_Rating item in the Customers block of an Order Entry form must be restricted to three
possible values: Good, Poor, or Null (the latter value indicates that the credit rating has not been
determined). Order entry clerks must be able to update this item to any of the preceding three
values.
You want to change the item to a check box labeled "Credit Risk" that should be selected if the
customer has poor credit, the check box should not be selected if the customer's credit rating is good
or undetermined.
You change the item type to Checkbox, set other properties as shown in the Exhibit, and then run
your form and insert three records: two with good credit and the check box deselected, and one with
poor credit and the check box selected. You commit the data and query the records, with the
following result set:
The first two records show an undetermined credit rating, although your intention was to set the
value to Good for these customers. What change must you make in the properties of the
Credit_Ratinq item to enable values of Good, Poor, and Null to be entered?
F
Explanation:
Incorrect answers:
F: A check box is not limited to two values.
When tabbing through items in the Employees form, users should not be able to navigate to the
Salary text item. If they need to update the item, they will have to explicitly navigate to it by using
the mouse.
Which property setting accomplishes this requirement?
A
You have a text item in your form named Object1. You want to create Object2 as an exact duplicate of
Object1. You want to be able to change the properties of Object2. However if you change Object1,
you do not want Object2 to change.
Which method of reusing Object1 would be best for these requirements?
A
The Orders form has four blocks. The Orders and Order_items block are on the CV_Order content
canvas; the inventories block items are on the CV_inventories content canvas; and Control block
buttons are on the CV_Buttons toolbar canvas. All buttons have mouse Navigate set to No.
The Order_Items block is a detail of Orders. The inventories block is a detail of Order_Items, showing
the stock of the selected product.
There is a button in the Control block with a When-Button-Pressed trigger:
IF GET_CANVAS_PROPERTY(:SYSTEM.cursor_item, item_canvas) = 'CV_ORDER' THEN
GO_BLOCK ('inventories')
ELSE
GO_BLOCK('orders');
END IF;
When you run the form and click the button, navigation does not occur, and the form displays the
runtime error FRM-41053: Cannot find Canvas: invalid ID. What should you do to correct this
problem?
C
Which four types of variables must have their names preceded by a colon when they are referenced
in trigger code?
BCDE
The Order Entry application contains several forms. The inventories form uses an LOV that is based
on a record group that queries the Warehouses table to return a warehouse ID.
Several of the forms use LOVs that are based on the same query. You decide to centralize the creation
of the record group to the entry form of the application, which opens all the other forms, for
example, to open the inventories form, there is a When-Button Pressed trigger on the inventories
button with the following code;
OPEN _FORM ('inventories');
in a When-New-Form-instance trigger for the entry form, you create the warehouse_rg record group
by using the CREATE_GROUP_QUERY built in with the following arguments:
('warehouse_rg' , 'SELECT ALL WAREHOUSE.WAREHOUSE_ID, WAREHOUSE.WAREHOUSE_NAME
FORM WAREHOUSE order by warehouse_name);
You also populate the record group in this trigger.
What must you do to make this record group available to the inventories form and the other forms?
A
Explanation:
Note: The CREATE_GROUP_FROM_QUERY built-in is a function and must be invoked as part of an
expression. For example:
DECLARE
rg_id
RecordGroup;
BEGIN
rg_id := CREATE_GROUP_FROM_QUERY ('employee_rg', 'SELECT id,first_name,last_name,sal FROM
employee');
END;
View the Exhibit.
Iin the Human Resources form shown in the Exhibit, you want to modify the prompts, heights, and
widths of the Department Id, Manager Id, and Location Id Holds in the Departments data block.
What must you select before invoking the Layout Wizard in reentrant mode to modify these item
properties?
A
You are implementing a JavaBean in a form, the bean has no visible component on the form when
invoked, the bean displays an input text where users enter a zip code, the bean has a single method
that returns a short weather forecast for that zip code as a character value.
How can you retrieve that value so that you can display it to the user?
D
Explanation:
When a user interacts with a JavaBean at run time, it usually causes an event to occur.
You can use FBEAN.ENABLE_EVENT to register a listener for the event, so that when
the event occurs Forms will fire the When-Custom-Item-Event trigger. In this trigger, you
can code a response to the event. The :SYSTEM.CUSTOM_ITEM_EVENT and
:SYSTEM.CUSTOM_EVENT_PARAMETERS variables contain the name of the event and
information the bean is sending to the form.
The Orders database table uses Order_id as its primary key. You have written the following code to
use in the Orders block of a form:
SELECT orders_seq.NEXTVAL
INTO :orders.order_id
FROM SYS.dual;
Which statement is true about this code?
F
Explanation:
Assigning Sequence Numbers to Records
You will recall that you can assign default values for items from an Oracle sequence, to
automatically provide unique keys for records on their creation. However, if the user does
not complete a record, the assigned sequence number is wasted.
An alternative method is to assign unique keys to records from a Pre-Insert trigger,
just before their insertion in the base table, by which time the user has completed the
record and issued the Save.
Assigning unique keys in the posting phase can:
* Reduce gaps in the assigned numbers
* Reduce data traffic on record creation, especially if records are discarded before
saving
Example
This Pre-Insert trigger on the ORDERS block assigns an Order ID from the sequence
ORDERS_SEQ, which will be written to the ORDER_ID column when the row is
subsequently inserted.
SELECT ORDERS_SEQ.nextval
INTO :ORDERS.order_id
FROM SYS.dual;
In Forms Builder, the iconic buttons on the form are blank, but when you click Run Form the form
appears in the browser with Images in the iconic buttons.
What are two things that you can check to track the source of this problem?
B, D
You want to display employee records in tabular format, but the form is not wide enough to display
all the items in the Employees block. The employee IDs and names of displayed records should
always be visible, but you want to scroll the additional information as users tab through the Items,
the form should look like a spreadsheet with the first two columns frozen.
Which canvas types would be most appropriate in this scenario?
D
Explanation:
After an entity is divided into groups, if all groups cannot be displayed simultaneously,
it becomes necessary for two or more regions to be displayed in the exact same space,
one at a time, using a Tab control. The user can jump to a specific region by selecting a
tab or by progressing continuously through all fields of all Tab regions. A set of fields,
minimally the primary key fields, should remain visible so the user can maintain
context at all times. There, "frozen" fields must be placed inside the Tab control on the
left side.
When best to use Tab regions:
* When the user must see all fields of a record in a single window, but they do not
need to see them all simultaneously.
* When entire regions need to be hidden from a user due to security restrictions, the
current state of data, or other product installations.
You have created a complex menu structure with several types of menu objects. To which objects
would you assign menu commands?
E
Explanation:
The Menu Editor is a graphical design facility for laying out, modifying, and viewing menu modules
and their objects. You can use the Menu Editor to carry out all of your menu design work.
Note:
To use the Menu Editor to create a basic structure for your menu, perform the following steps:
1 .
With the SUMMIT_MENU module selected, perform one of the following actions to invoke the Menu
Editor:
Double-click the icon to the left of the module
Right-click the module and select Menu Editor
Select Tools > Menu Editor from the Forms Builder menu
2 .
When you invoke the Menu Editor, it automatically creates the main menu and one menu item. The
main menu is the menu whose items, which can be menu items or submenus, show in the menu bar
when you run a form.
In the Object Navigator, change the name of the main menu to MAIN_MENU in the same way that
you changed the name of the menu module.
3 .
In the Object Navigator, change the name of the menu item to File.
4 .
Note that the item's display label in the Menu Editor remains the same.
The label is the text that is displayed for the menu item at run time. The label may differ from the
name. You use the name programmatically, and it must follow PL/SQL naming conventions.
Change the label of the menu item by double-clicking <New_Item> in the Menu Editor and typing
the new label of File.
5 .
Create two menu items under File. In the Menu Editor, select File, then click Create Down twice.
6 .
In the Menu Editor, relabel the menu items to Save and Exit.
Note that creating menu items under the File object creates a FILE_MENU object as a menu with two
items under it. Also, when you relabel the items in the Menu Editor, the names of the items, as
shown in the Object Navigator, also change.
7 .
Create another submenu of the main menu and label it Edit by performing the following steps:
In the Menu Editor, select the File node.
Click Create Right.
Relabel the new menu Edit.
8 .
In a similar fashion to the way you created the File menu items, create two items for the Edit menu
labeled Copy and Paste.
9 .
You can also use the Object Navigator to add a menu item.
Under the Edit_Menu in the Object Navigator, select the Items node and click Create.
10 .
In the same way as you did with other items, relabel the new item in the Menu Editor with the label
Cut, which also renames it in the Object Navigator.
Reference: Creating Oracle Forms Menus
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?
D
To avoid overloading the database during busy times, you decide to restrict the queries that are
executed on the Orders form so that users query by either Order ID or Customer ID during these
times. Which trigger is most appropriate for the code to enforce this restriction?
D
Explanation:
About controlling queries with Pre-Query and Post-Query triggers
The Pre-Query and Post-Query triggers allow control over query processing. They can be defined at
the form or block level. Most often, attach them to specific blocks to control the query functionality
of those blocks.
The Pre-Query trigger fires just before Form Builder issues the SELECT statement to the database,
after the operator has defined the example record by entering query criteria in Enter Query mode.
Inside a Pre-Query trigger, the example record defined by the query criteria is the current record.
This means that trigger code can read and set the values of items in the example record using
standard :block_name.item_name syntax.
A Pre-Query trigger can be used to disallow query conditions that might be invalid. When a form is
in Enter Query mode, normal validation is suspended and no validation triggers fire as they do in
Normal mode. The Pre-Query trigger thus allows you to verify that any values entered by the
operator are valid query conditions.
When invalid query conditions have been entered, you can abort the query by raising the
FORM_TRIGGER_FAILURE built-in exception in the Pre-Query trigger.
You can also call SET_BLOCK_PROPERTY to modify the block's WHERE and ORDER BY clauses from
within the Pre-Query trigger, to further restrict or order the records the query will retrieve.
You have created an editor named MyEditor, and you want it to be available to edit the text item
Product_Description. You can associate the editor with the text item by setting the Editor property of
Product_Description to MyEditor.
A