How can you avoid this error when using a global variable as a way to pass data between forms?

Exhibit:

You are developing an Order Entry application. The Customers form calls the Orders form and passes the value of Customer_Id as a global variable so that the orders for only that customer are displayed. When you run the Orders form by itself, you receive the error shown in the exhibit. How can you avoid this error when using a global variable as a way to pass data between forms?

Exhibit:

You are developing an Order Entry application. The Customers form calls the Orders form and passes the value of Customer_Id as a global variable so that the orders for only that customer are displayed. When you run the Orders form by itself, you receive the error shown in the exhibit. How can you avoid this error when using a global variable as a way to pass data between forms?

A.
Use the following code in the When-New-Form-Instance trigger of the Orders form:
:global.customer_id := NULL;

B.
Check to see if the global variable has a value before using it in the Orders form with the following condition:
IF :global.customer_id IS NOT NULL THEN

C.
Use the following code in the Pre-Form trigger of the Orders form:
DEFAULT_VALUE(NULL,’global.customer_id);

D.
Use a different method to share data between forms because you cannot avoid this error when using global variables and running a form by itself.



Leave a Reply 0

Your email address will not be published. Required fields are marked *