Home » Developer & Programmer » Forms » Enable Insert button for 1 record only
Enable Insert button for 1 record only [message #581220] Wed, 03 April 2013 10:11 Go to next message
cornwall
Messages: 36
Registered: June 2009
Member
I have a form with a block at header level. Once you save your header, there is a second block at line level.
I want to be able to enter only one record at header level and line-level.

Also if you search on an instance which already has a record at line-level then i want the insert button to be greyed out.

Similarly once you create your first record at line-level the Insert button should be greyed out.

How can this be acheived?
Re: Enable Insert button for 1 record only [message #581245 is a reply to message #581220] Wed, 03 April 2013 13:24 Go to previous message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I don't have Forms here so I can't test it myself, but - here's an idea: create a WHEN-NEW-RECORD-INSTANCE (or, possibly, WHEN-CREATE-RECORD) form-level trigger (why not block-level? Because you want it to affect the whole form, both blocks. You could, of course, create one trigger per block, but - why would you?).

Put something like this in there:
if :system.trigger_record > 1 then
   message('One record only');
   raise form_trigger_failure;
end if;

(I'm not sure that you can disable Forms toolbar's "insert" button.)
Previous Topic: Generate Query Result in oracle form 10g
Next Topic: R12 form customization (content canvas with tab canvas and 2 stacked canvas)
Goto Forum:
  


Current Time: Fri Apr 19 09:56:07 CDT 2024