Customers log in to your Orders application by using their customer ID, which is saved as a global
variable. When the Orders form first comes up, you want it to be populated with the customer’s
orders, and you do not want customers to be able to query for another customer’s orders.
You code the following triggers:
When-New Form instance on the Orders form:
GO_BLOCK(‘orders’);
EXECUTE_QUERY;
You also have a button in the Control block labeled Query Orders with a When-Button Pressed
trigger that has the same code as the When New-Form instance trigger.
To test the form, you run it and log in a Customer 104. When you click Query Orders, all orders
are shown, not just those for Customer 104.
What is the best way to correct this issue to ensure that the customer can never query another
customer’s orders?
A.
Delete the Key-Exeqry trigger and add the its first line after the call to GO_BLOCKinthe WhenNew-Form-instance trigger.
B.
Change the last line of the When-Button-Pressed code to:
DO_KEY (‘EXECUTE_QUERY’);
C.
Delete the Key-Exqry trigger and put its codeinan On-Select trigger.
D.
Delete the Key-Exqry trigger and put its codeina Pre-Query trigger.
Explanation:
Note: EXECUTE_QUERY procedure
Clears the current block, opens a query, and fetches anumber of selected records. If there are
changes tocommit, Forms Builder prompts the operator to committhem before continuing
EXECUTE-QUERYprocessing
Answer D