Link to home
Start Free TrialLog in
Avatar of creativepresence
creativepresence

asked on

Oracle Forms Insert Button

I am trying to add an insert record button in to a detail block on a form of which also has a master block linked to the detail block.  I have got a button on the detail block, with a when_button_press trigger with the code insert_record, but this does not work.  Although, if i press the record/insert drop down option it will insert a record into the detail block.  So how can i create the same action but via a form button?
Avatar of andrewst
andrewst

You need to use the CREATE_RECORD built-in rather than INSERT_RECORD, then the button will work.
Avatar of creativepresence

ASKER

Hi, How could i associated the block WHEN_CREATE_RECORD trigger with the button on the form so that when the user presses the button it goes into insert mode? because the button does not offer the WHEN-CREATE_RECORD trigger.
ASKER CERTIFIED SOLUTION
Avatar of andrewst
andrewst

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
lol. ok can i just to clear this up in my head as im having a blonde day, would you mind explaining the process to me?  I need a WHEN_CREATE_RECORD trigger on the data block? contaning what code? i do not have a KEY-CREREC trigger? should i have one & if so where & containing what?
Thank you.

OK, let's back up a bit.  Forget about the WHEN-CREATE-RECORD trigger - you don't need it.

Just do this:

1) Create your button

2) Create a WHEN-BUTTON-PRESSED trigger associated with the button

3) In the WHEN-BUTTON-PRESSED trigger code just put the following line:

DO_KEY('CREATE_RECORD');

4) Save and run
Hi Andrew, problem solved, but thanks.
OK, let's back up a bit.  Forget about the WHEN-CREATE-RECORD trigger - you don't need it.

Just do this:

1) Create your button

2) Create a WHEN-BUTTON-PRESSED trigger associated with the button

3) In the WHEN-BUTTON-PRESSED trigger code just put the following line:

DO_KEY('CREATE_RECORD');

4) Save and run