1Z0-141 - Oracle Forms: Build Internet Applications

Go back to Oracle

Example Questions

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? 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? 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? 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? 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? 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). 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? 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? 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? 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.) 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? Which statement about the Data properties of a text item is true? 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? What is an indication that the Data Block Wizard is in reentrant mode? 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? 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? 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? 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? 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? 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? 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? 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? 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? 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? Which statement is true about client-side validation? 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? 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? 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? 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? 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? Which statement about object libraries is true? You are testing a form. How can you programmatically disable validation during testing? 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? 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? 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? What happens when you click Run Form Debug in Forms Builder? 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? 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? 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? 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? 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? 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? 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? 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 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? 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? 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? 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? 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?