Home » Developer & Programmer » Forms » Search Button
Search Button [message #601594] Fri, 22 November 2013 10:16 Go to next message
amjad_alahdal
Messages: 102
Registered: October 2013
Location: Saudi Arabia
Senior Member
Hello,

I have created a search button, and I used this code when the key is pressed ::


if (name_in('SYSTEM.MODE') != 'ENTER-QUERY') then do_key('ENTER_QUERY');
else do_key('EXECUTE_QUERY');
end if;



and,, the problem is when I press it, it goes to the first record,,,, to visualize the problem,,
I have the following record,,
Year,,,
Number ,,
Name ,,,etc,,,
If I want to search by the number, once I click on the button, it goes to the year field,,,,,
How can I make it search according to the current item,,,,
Re: Search Button [message #601605 is a reply to message #601594] Fri, 22 November 2013 15:00 Go to previous messageGo to next message
Littlefoot
Messages: 21809
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
As far as I can tell, you can't do that. ENTER_QUERY sets focus to the first query-allowed item in a current block. You can't even
enter_query;
go_item('number');
because as soon as form enters query mode, it waits for you to enter search criteria and execute query. Therefore, enter query mode, navigate to desired item, enter search criteria, execute query.

By the way, why would you code that? Forms built-in functionality does that perfectly well (using either toolbar buttons or keyboard shortcuts).
Re: Search Button [message #601630 is a reply to message #601605] Sat, 23 November 2013 05:41 Go to previous messageGo to next message
amjad_alahdal
Messages: 102
Registered: October 2013
Location: Saudi Arabia
Senior Member
Because, I wanted to make it more easier for the user. I wanted to make it a search engine for any field. Would it be possible ?
Re: Search Button [message #601638 is a reply to message #601630] Sat, 23 November 2013 10:59 Go to previous message
Littlefoot
Messages: 21809
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I don't know; probably. I'm quite satisfied with search capabilities Forms offers.
Previous Topic: list item problem
Next Topic: How to call/ run from developer 11g
Goto Forum:
  


Current Time: Thu May 16 21:27:05 CDT 2024