1Z0-141 - Oracle Forms: Build Internet Applications
Go back to Oracle
While updating an existing customer record using the Customers form, the user invoked the Orders form by clicking the CONTROL.Orders_btn button. The When-Button-Pressed trigger had the following code: CALL_FORM('orders'); There is a requirement to navigate back to the Customers form after the order details have also been updated. This will be achieved through a form-level Key-Exit trigger in the Orders form. Which code should be used?
IF GET_APPLICATION_PROPERTY(calling_form) IS NOT NULL THEN EXIT_FORM(ASK_COMMIT, NO_ROLLBACK); ELSE EXIT_FORM; END IF;
In a multiform application, one form must invoke another. The form modules are called Customers and Orders internally, but the compiled files are saved as CUST.FMX and ORD.FMX, respectively. There is a button in the Customers form with a When-Button-Pressed trigger to invoke the Orders form. There is a requirement that only one Orders form can be running at a time, so the trigger must check to see if the form is already open. If it is open, the focus must be sent to it. If it is not open, it has to be opened. Which of these trigger codes will achieve the required functionality?
IF ID_NULL(FIND_FORM('orders')) THEN OPEN_FORM('ord'); ELSE GO_FORM('orders'); END IF;
The Orders.fmb module contains two content canvases, both associated with the default window. Items from the DEPT data block are associated with the DEPTCAN canvas. Items from the EMP data block are associated with the EMPCAN canvas. The user wants to view DEPT and EMP data at the same time. What changes would you make to the Orders form?
Create a new WINDOW object called DEPTWIN. To associate the DEPTCAN canvas with the DEPTWIN window, set the DEPTCAN Window property to DEPTWIN.
The following On-Error trigger was written to give users a more meaningful message when they press the Up key when the cursor is in the first record (the FRM-40100 error) and to display default messages for all other errors: IF message_code = 40100 THEN MESSAGE('You are already at the first record'); ELSE MESSAGE(message_type || '-' || to_char(message_code) || ': ' || message_text); END IF; When you test the form, you still get the FRM-40100 message when you press the Up key while the cursor is in the first record. Your custom message does not appear. What corrections can you make so that the code functions properly?
Change all occurrences of message_code, message_type, and message_text to error_code, error_type, and error_text.
You are developing an application for use by meteorologists. Form1 contains a list item based on a query of cloud types that are stored in a database table. Users can add cloud types to the list by typing in new values that are automatically inserted to the database table. Form1 calls Form2, which contains an identical list item. You do not want to requery the database to obtain the list of cloud types. Which method can you use to pass the cloud types from Form1 to Form2?
Global record group
What are two ways that you can assign a value to an item on a form from within the code of a menu item? (Choose two).
Use the COPY built-in.
Use the EXECUTE_TRIGGER built-in to call code in the form that assigns the value.
Order entry clerks use the Orders form to enter the shipping date of an order. Once the shipping date has been entered into the database, the clerks are not allowed to modify it. What property can you set in the Property Palette for the Shipping_Date item to ensure that this data entry restriction is enforced?
Update Only If NULL
The Orders table in the database contains several thousand records. There is a block in the Orders form that is based on the ORDERS table and displays one record. The block is ordered by the Order_Date in descending order, because order entry clerks usually must access only the most recent orders. Which one of the following combinations of property settings for the Orders block will provide the fastest response time before a record appears in the block upon executing a query?
Query Array Size: 0 Number of Records Buffered: 1000 Query All Records: No
While using the LOV Wizard to create the LOV called SALES_REP_LOV, which is based on the SALES_REP_RG record group, you assign it to the Sales_Rep_Name item in the form that you are developing. After the LOV is created, you realize that you should have assigned the LOV to the Sales_Rep_Id item instead. What can you do to make this change?
Delete the value in the List of Values property for the Sales_Rep_Name item and set the List of Values property of the Sales_Rep_Id item to SALES_REP_LOV.
You have the Orders form open in Forms Builder. You create an object group in the Orders form and you try to drag various components in the Object Navigator to the object group. Which two components will you be unable to place in the object group? (Choose two.)
the When-New-Item-Instance trigger of the Order_Items.Quantity item in the Orders from
the Product_Id item in the Order_Items block of the Orders form
You want to create a calculated item in the Control block of the Human Resources form. This item will contain the total of employee salaries for employees in a particular department. Which statement is true about how to create the calculated item?
You can create it by first creating a display item and then setting appropriate properties in its Calculation property group.
Which statement about the Data properties of a text item is true?
If the Data Length Semantics property is set to BYTE, you may need to manually adjust the Maximum Length property depending on the character set that is being used.
Your company assigns three possible credit ratings to customers: Poor, Good, and Excellent (represented numerically by 1, 2, and 3). The DBA has just added a RATING column to the CUSTOMERS table and has asked you to add an item to your form so that credit ratings can be recorded. To restrict data entry clerks to one of these three values, you decide to create a radio group for the Rating item. You want to allow for an undetermined (Null) credit rating, and users should be able to update the credit rating from a value to an undetermined rating. How can you implement this?
Create four radio buttons, and leave blank the value for the undetermined credit rating.
What is an indication that the Data Block Wizard is in reentrant mode?
There is a tabbed interface.
You have been asked to correct a problem with a form that was created by another developer. Users complain that they are unable to query on the employee Hire Date, which is a base table item. What is a possible cause for this problem?
The Hire Date item is a display item.
You are developing a Human Resources form with a single block to display employees. For each employee, you look up the department name to display in a non-base-table item. When you test the form, you discover that when you enter a new employee as the first employee in a new department that has not yet been created in the database, you get the following error when you try to navigate out of the Department_Id item: FRM-40735: WHEN-VALIDATE-ITEM trigger raised unhandled exception ORA-01403. The ORA-01403 exception is the NO_DATA_FOUND exception. When this message is received, you cannot navigate out of the Department_Id item. You add the following code to the When-Validate-Item trigger on the Department_Id item to display a meaningful message to the user: EXCEPTION WHEN NO_DATA_FOUND THEN MESSAGE('You must create the department before adding employees to it'); You run the form again to test it, and you enter a new employee and a department ID that does not exist in the database. When you click into the Employee_Name item, the appropriate message is displayed, but the cursor moves to Employee_Name. What must you change so that the user will not be able to navigate out of the Department_Id item when entering a department ID that is not in the database?
Add the following line at the end of the exception handler: RAISE FORM_TRIGGER_FAILURE;
You are building the Customer.fmb module, and you define a multirecord data block based on the CUSTOMERS table. The data block is called CUST. You specify a Tabular layout style for the CUST items. When the window is at its maximum size, only some of the items can be viewed in the window. To view all items together, you should enable users to scroll horizontally through the CUST items; however, the Cust_ID and Cust_Name items should always be visible. Which combination of canvas types is most appropriate to display the CUST items together?
Content canvas and an overlay stacked canvas
You designed a standard toolbar to accompany a number of forms so the code behind the buttons is written as generically as possible. One of the features of this toolbar is that the buttons are synchronized with the state of the form. To achieve this functionality, you wrote generic procedures that are placed in an attached library and are called from various triggers. For example, if the form is in Enter-Query mode, the procedure set_enter_query_mode will disable the Enter Query button, change the icon for the Exit button, and modify its Tooltip to read "Cancel Query" rather than "Exit". What must you code to support this approach?
Form-level Key triggers that call the generic procedures and item-level When-Button-Pressed triggers that call the DO_KEY() built-in. For example, Key-Entqry has the following code: set_enter_query_mode; The When-Button-Pressed trigger on the Enter Query button has the following code: DO_KEY('ENTER_QUERY');
You have been asked to define a data block based on a JOIN of multiple tables. The read-only data will be used for calculations and lookups. The DBA is on holiday and is unable to define a view on the database server. What is the simplest way for you to continue to build the form?
Define a data block based on a From Clause query.
There is a requirement to modify the default functionality of the [Commit] key. To implement this requirement, you decide to write a Key-Commit trigger that will force validation and issue a commit if necessary. Which trigger code will achieve this?
ENTER; IF :SYSTEM.FORM_STATUS = 'CHANGED' THEN COMMIT_FORM; END IF;
The DBA informed you that a number column called ORDER_STATUS has been added to the ORDERS table. The DBA ran a SQL script to populate that column. You want to update the Orders form to display the additional data. You currently have a non-base-table display item in the Orders block called Order_Total that you no longer want to use. The Order_Total item is located on the canvas in the position where you want the Order_Status item to appear. You open the Property Palette for Order_Total, change its name to Order_Status, and change its item type to Text Item. You run the form, but when you execute a query on the block, no data is displayed in the Order_Status item. What should you do to correct this problem?
Set the Database Item property to Yes for the Order_Status item.
You are developing a Human Resources form for HR clerks to insert, update, and delete records from the EMPLOYEES table. When the user commits records, Forms displays the default informative message "FRM-40400: Transaction complete: <n> records applied and saved." You want to replace that with the message "Records inserted: <n> Records updated: <n> Records deleted: <n>", where <n> represents the number of records inserted, updated, and deleted. Which triggers must you create or modify to accomplish this?
Post-Insert, Post-Update, Post-Delete, and On-Message
You are developing a Human Resources form for HR clerks to insert, update, and delete records from the EMPLOYEES table. You are also maintaining an audit table with the following table description: SQL> desc audit_changes Name Null? Type ------------------ --------------- ----------------- TABLE_NAME VARCHAR2 (30) ID NUMBER TIMESTAMP DATE CHANGE_BY VARCHAR2 (30) CHANGE_TYPE VARCHAR2 (6) Valid values for the CHANGE_TYPE column are INSERT, UPDATE, and DELETE. Which trigger(s) must you create or modify in the Human Resources form to track all the information in the audit table?
Post-Insert, Post-Update and Post-Delete
You are developing a form that uses alerts to display database messages rather than associated FRM messages when the SQL statements issued by the form cause database errors to occur. You use a generic alert called DB_Alert to display the messages. You begin to code an On-Error trigger to trap the FRM-40505 error that occurs when the SQL statement references an invalid column name. The associated database message is "ORA-00904: Invalid column name", and this is what you want to be displayed in the alert. You create a form-level On-Error trigger with the following code: DECLARE n NUMBER; BEGIN IF ERROR_CODE = 40505 THEN SET_ALERT_PROPERTY('DB_Alert',ALERT_MESSAGE_TEXT, DBMS_ERROR_CODE); n := SHOW_ALERT('DB_Alert'); END IF; END; You run the form to test it. What will the run-time behavior be when the FRM-40505 error is encountered?
The alert called DB_Alert appears, but not with the correct message.
Which statement is true about client-side validation?
It requires setting an item's Implementation Class property.
You are designing a Human Resources application that uses a menu to implement most of the code. One of the menu items is labeled Raise Salary. The business rule is that the salary should be raised 2% if the salary of the selected employee shown in the form is less than $25,000 per year, but the raise should be 3% if the value of the salary item is $25,000 or greater. Which condition can you use in the menu code to determine if the current value of the Salary item in the Employees block is less than $25,000?
IF NAME_IN('EMPLOYEES.SALARY') < 25000 THEN...
During testing, you received comments that the default functionality of the [Commit] key can cause an error message to be displayed if there are no changes to save when it was activated. You decide to provide a button for users to validate the form and issue a commit if necessary. To implement this, you write a form-level procedure called VALIDATE_AND_COMMIT. The same functionality must be provided when the user chooses File > Save from the menu or presses the [Commit] key. Which should you use?
The When-Button-Pressed trigger with the code DO_KEY('COMMIT_FORM'); A form-level Key-Commit trigger with the code validate_and_commit;
You are running a multiple-form application. The Customers form invokes the Orders form. When the Orders form launches, it displays orders for only the active customer from the Customers form. Forms exchange data with the :GLOBAL.CUSTOMER_ID variable. The Orders form should be restricted to orders for the current customer only the first time a query is issued after invoking the Orders form. Which built-in helps you do this by setting the ONETIME_WHERE property to refer dynamically to the GLOBAL.CUSTOMER_ID?
An application is accessed through the Summit form, which can open the Customers form and the Orders form. The Customers form can also open the Orders form, and the Orders form can open the Customers form. What should you do to ensure that forms are closed in the proper order so that the session closes down when the last form is exited?
You do not need to do anything. No matter which form is closed last, the session will close properly.
The validation unit for the Orders form is set to Item. This master-detail form contains an Orders block and a multirecord Order Items block. Why might you want to create a When-Validate-Record trigger on the Orders block in this form?
to check that the shipping date for the order is not earlier than the order date
The Products.fmb module has one content canvas, which displays information about products sold by your company. You increase the canvas display area by creating an overlay canvas to enable product images to be displayed on request. At run time, however, the overlay canvas is never displayed; users complain that there is only a brief flash on their screen. How do you correct this problem?
Ensure that the current item is not hidden by the overlay canvas.
Which statement about object libraries is true?
Using object libraries can increase network performance by promoting object similarities.
You are testing a form. How can you programmatically disable validation during testing?
Use the SET_FORM_PROPERTY built-in to set the VALIDATION property.
You are developing a form that serves as a front end to access the Order Entry application. Within the form you want to store the usernames of those users who have permission to run the application. This information is accessed when the form starts up to determine if the user is authorized. The list of usernames is not stored in the database and should not be visible to users. How will you store this information?
In a record group
You are running a form in debug mode and you begin to step through the code of a lengthy subprogram. After stepping through a few lines of its code, you realize that the error comes not from the code in that particular subprogram but from code that is executed after it. At this point, how can you immediately jump to the next line of code after the call to the subprogram?
Click Step Out to resume stepping through code after the subprogram is called.
The user must be able to invoke a list of values for valid sales representatives in the Orders form. To facilitate this, you created a button and positioned it next to the Sales Rep Id field. The text item has these properties set: - Required: Yes - List of Values: SALES_REP_LOV - Validate from List: No The button has these properties set: - Keyboard Navigable: Yes - Mouse Navigate: Yes - Iconic: Yes - Icon Filename: list.ico An appropriate LOV has been created (called SALES_REP_LOV) and associated with the text item. An icon file (list.gif) exists in the appropriate directory. All other properties are left at their defaults. You write a When-Button-Pressed trigger at the item level with this code: LIST_VALUES; To test the form, you attempt to enter a new record. What is the run-time behavior of the form?
The icon is not displayed on the button. When you click in the Sales Rep Id field and then click the button, the LOV is not invoked and an error is reported.
What happens when you click Run Form Debug in Forms Builder?
The form runs in a three-tier environment using the application server URL that you specify in run-time preferences.
To centralize some of your processing, you decide to write PL/SQL library modules that contain procedures that can be called from form triggers or menu items. You need to populate some fields based on values in other fields. Which code do you use?
IF NAME_IN('ORDERS.order_total') > 10000 THEN COPY('Y','ORDERS.large_order'); MESSAGE('WARNING - large order!'); END IF;
The Summit application contains several different forms. You are developing the Orders form of the Summit application. You have coded a trigger in the form to retrieve and format the address of the customer placing the order so that you can print a mailing label. However, as you add functionality you discover that you want to use the same code in several triggers in that form. The other forms in the application do not use this logic. Without creating a separate module, how can you reuse the code within the Orders form and ensure that all triggers that format and retrieve the customer address do it in exactly the same way?
Move the code to a PL/SQL program unit in the Orders form.
You start an OC4J instance on your development PC and then run a form from the Forms Builder. Which statement describes the behavior of OC4J?
It appears in a separate window, which you should not close or the OC4J instance will abort.
You have an image item in the Employees form to display an employee photograph. The image item has default values for its properties. You are trying to decide where to place some code to manipulate the image item. If you place the code in a When-Image-Activated trigger, when will the code be executed?
when the user double-clicks the image item
The menu that appears by default in a Forms application does not quite meet your needs, so you decide to create a custom menu. You create and compile a menu module called Test with three submenus that contain PL/SQL code, and you attach the Test menu to a form. How will the menu of the form appear and perform at run time?
You will see only the three submenus from the Test menu (plus the Window menu that is usually displayed), and you will not be able to call code from the default menu in your form.
In the Product.fmb module, data block items are displayed on two content canvases. You define a set of icon buttons that users must have access to at all times. Which canvas type is appropriate to display the buttons?
Horizontal Toolbar canvas that is associated with the same window as the two content canvases
The Products.fmb module has one content canvas, which displays information about products sold by your company. You want to increase the canvas display area by creating an overlay canvas to enable images of selected products to be displayed on request. How can you size the display area of the overlay canvas?
Define the display area for a stacked canvas by using the built-in procedure SET_VIEW_PROPERTY.
You are developing a form for customers to order tickets to events. There is an Event_Date item in the Tickets block of the form that has an LOV whose record group uses the following query: SELECT event_name, event_date FROM events ORDER BY event_date In the Choose_Event block of the form, you want users to be able to select an event name into an Event_Name item. The event name will be selected from an LOV that is sorted by the name of the event. You do not want to modify either the LOV or the record group at run time. Which statement is true for the LOV and the record group as specified at design time?
You must define a new LOV for the Choose_Event.Event_Name item that uses a different record group.
You have been asked to define a data block based on a query that is dependent on SQL only. The data will not be updated by the user. Selection of the tables to be queried will be decided by the user at run time. How should you define the appropriate data source?
Define a data block based on a Ref Cursor.
Consider the following scenario: In a multiform application, the user started in FormA. 1. From FormA, the user invoked FormB using CALL_FORM. 2. From FormB, the user invoked FormC using OPEN_FORM. 3. From FormC, the user invoked FormD using OPEN_FORM. 4. From FormB, the user invoked FormE using CALL_FORM. There is an additional form in the application, called FormF. Which statement is true?
FormF can be invoked from FormE using CALL_FORM.
You apply the Btn_PC property class to the Exit button and then make several changes in the property values of the button. The Btn_PC property class includes the item type Push Button. You accidentally change the Item Type property of the Exit Button to Check Box. How can you change the Item Type of the Exit button back to Push Button, restore the subclassed relationship of the Item Type to the property class, and retain any other property changes that you have made?
Select the Item Type property of the Exit button and click Inherit.
The Orders form has two base table blocks and a control block. There is an Execute Query button in the control block with the following When-Button-Pressed trigger: DO_KEY('execute_query'); A user navigates to the Order Items block and clicks Execute Query. The query does not execute, but instead returns error FRM-41003: "This function cannot be performed here." What can you do to fix this error?
Set the Mouse Navigate property to No for the Execute Query button.
The DBA informed you that a number column called ORDER_STATUS has been added to the ORDERS table. You want to update the Order Entry form to display the additional data. You open the Layout Editor for the canvas on which items from the Customers, Orders, and Order_Items blocks are displayed. You use the text item tool to create a new text item on the canvas, then open its Property Palette and set the Name property to ORDER_STATUS and the Column Name property to Order_Status. When you run the form to test it, you receive the error "FRM 40505 ORACLE error unable to perform query." What could be the cause of this error?
You did not select the Orders block from the block poplist in the Layout Editor prior to creating the item.