?
Solved

Oracle Forms Insert Button

Posted on 2003-02-26
7
Medium Priority
?
8,064 Views
Last Modified: 2012-05-04
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?
0
Comment
Question by:creativepresence
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 15

Expert Comment

by:andrewst
ID: 8025345
You need to use the CREATE_RECORD built-in rather than INSERT_RECORD, then the button will work.
0
 

Author Comment

by:creativepresence
ID: 8026450
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.
0
 
LVL 15

Accepted Solution

by:
andrewst earned 140 total points
ID: 8026516
You don't need to.  When the CREATE_RECORD built-in is called to create a record, any triggers associated with the creation of a record (like WHEN-CREATE-RECORD) will be fired automatically.

The only code that would NOT be run is anything other than the CREATE_RECORD call in your KEY-CREREC trigger, if you have one.  To make sure that all code in the KEY-CREREC trigger is run, do this:

Item:    (your insert button)
Trigger: WHEN-BUTTON-PRESSED
Code:    DO_KEY('CREATE_RECORD');

Now whenever you press the button, your KEY-CREREC will fire (if you have one).  If you don't have a KEY-CREREC, then the standard CREATE_RECORD will be done.
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 

Author Comment

by:creativepresence
ID: 8026779
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.

0
 
LVL 15

Expert Comment

by:andrewst
ID: 8026845
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
0
 

Author Comment

by:creativepresence
ID: 8026873
Hi Andrew, problem solved, but thanks.
0
 
LVL 15

Expert Comment

by:andrewst
ID: 8026896
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
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many‚Ķ
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question