techxplore blog
13 Nov

PL/SQL Code To Hide Oracle Form Button

There are times when an Oracle Form button needs to be hidden depending on certain criteria. I would like for example to prevent changing of the student status when they are Graduated or Completed from their study. Hiding the CHANGE STATUS button in an Oracle Form when the student is flagged as Graduated or Completed could be done using a pl/sql code which is fired during a WHEN-NEW-FORM-INSTANCE trigger.

An example of Oracle PL/SQL code to hide the button:
-- Tony
-- 24 July 2008
-- Purpose Hiding of CHANGE STATUS button in SIS-FM-109
-- when student status is Graduating (5), Graduated (G) & Completed (0)
-- 13 November 2008
-- Graduating (5) was excluded due to request by Arnold
begin
if :student.statuscode in ('G','0') then
hide_item('CONTROLBLOCK.CHANGESTATUS',TRUE);
else
hide_item('CONTROLBLOCK.CHANGESTATUS',FALSE);
end if;
end;

The simple PL/SQL code fires a procedure called HIDE_ITEM which accepts two parameters the object to be hidden and the state of the object. See HIDE_ITEM procedure from http://www.techxplore.net/2008/07/24/hide-and-unhide-oracle-forms-6i-button/ for the full code. The PL/SQL code help in hiding the Oracle Form button.

Leave a Reply