Home » Developer & Programmer » Forms » Oracle Forms 11g WHEN-BUTTON-PRESSED (Win 2008 Server OFM 11g)
Oracle Forms 11g WHEN-BUTTON-PRESSED [message #628244] Fri, 21 November 2014 12:58 Go to next message
deay
Messages: 62
Registered: August 2005
Member
hi everyone

I'm designing my first oracle forms project. I have the Master/Detail working correctly. the form looks for Customer info and related detail data.

in order to query the data via customer idnumber you have the enter_query, execute_query icons on the toolbar.

instead of using the toolbar I would like to create a custom button for users to press, then enter customer id then execute automatically.

my trigger code is something like this:

WHEN-BUTTON-PRESSED
enter_query;

GO_ITEM('CUSTOMER.IDNUMBER');

execute_query;

however this is not working, any help or tips on how I can get this to work would be greatly appreciated.

thanks in advance.
Re: Oracle Forms 11g WHEN-BUTTON-PRESSED [message #628250 is a reply to message #628244] Fri, 21 November 2014 16:14 Go to previous messageGo to next message
mughals_king
Messages: 392
Registered: January 2012
Location: pakistan
Senior Member
No No No not like that my friend. Okay ! you are going to create first form thn let me explain you little basic things regarding related to enter_query, Execute_query, go_item, go_block.

"Enter_query" Procedure 

Clears the current block and creates a sample record. 
Operator can the specify query conditions before executing the query with a menu or button
command. If there are changes to commit the form builder prompts the operator to commit them
before continuing ENTER_QUERY processing

"Execute_query" Procedure

Clears the current blocks opens the query and fetches a number of selected records. if there are
changes to commit forms builder prompts the operator to commit them
before continuing EXECUTE_QUERY processing.

"Go_block" procedure

Navigates to the specified block.

"Go_item" procedure

Navigates to the specified item.


just chk attached example fmb file.

Regard
Mughal

[Updated on: Fri, 21 November 2014 16:17]

Report message to a moderator

Re: Oracle Forms 11g WHEN-BUTTON-PRESSED [message #628280 is a reply to message #628244] Sat, 22 November 2014 07:53 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
deay wrote on Fri, 21 November 2014

instead of using the toolbar I would like to create a custom button for users to press, then enter customer id then execute automatically.

I don't use Forms 11g (but I doubt that these things have changed). So: once you enter query mode (ENTER_QUERY built-in in your WHEN-BUTTON-PRESSED trigger), Forms waits for user to enter search criteria (which is optional; you don't really have to enter anything) and execute query (normally, you do that by pushing the appropriate button in the toolbar or use keyboard shortcut). You can't "jump" into enter query mode and do anything; GO_ITEM is ignored, EXECUTE_QUERY is ignored, everything is ignored - you have to do that manually, which means that you need two buttons - one to enter query mode, another one to execute query.

Having said that, it appears that what you are doing is in vain as both of these buttons already exist in Forms' toolbar and do their job well. So, stop reinventing the wheel.
Re: Oracle Forms 11g WHEN-BUTTON-PRESSED [message #628370 is a reply to message #628280] Mon, 24 November 2014 09:37 Go to previous message
CraigB
Messages: 386
Registered: August 2014
Location: Utah, USA
Senior Member
Quote:
instead of using the toolbar I would like to create a custom button for users to press, then enter customer id then execute automatically.

What's wrong with using the Toolbar buttons? This is how Forms works. Smile

Will your user always query a customer id? If so, why not open your form in Query Mode. Then the user simply needs to enter the ID to search for and your Button will simply "Execute_Query".

I agree with LittleFoot - there really is no need to re-invent the wheel. The key to developing with Oracle Forms is to let Forms do what Forms does best and to only write code to enhance what Forms already does or to do things that Forms doesn't do.

Craig...
Previous Topic: frm-40735
Next Topic: Displaying PDF file which is placed on application server through forms 6i by using web.show_documen
Goto Forum:
  


Current Time: Sat Apr 20 11:19:45 CDT 2024