Referencing Form Objects in PL/SQL Menu Item Commands
Form menus are reusable modules that you compile separately from forms. Accordingly, to reference form objects in PL/SQL menu item commands, you must code differently than if you were referencing the same object in a trigger or user-named routine within a form. The following restrictions apply:
- You cannot directly reference the value of a Oracle Forms object; instead,
use the NAME_IN Built-in function to determine the object's current value.
IF :emp.title = 'MANAGER' -- incorrect
IF NAME_IN('emp.title') = 'MANAGER' -- correct
Note: The value
returned by the NAME_IN function is a character string. However, you also
can use NAME_IN to return numbers and Dates as character strings, and then
convert those strings to the appropriate data types.
- You cannot use direct assignment to set the value of a Oracle Forms object;
instead, use the COPY Built-in procedure.
:product.name := 'PUMP'; -- incorrect
COPY('PUMP', 'product.name'); -- correct