GETTING FORM OUT OF QUERY MODE (URGENT)

I have a form which start in Query mode, user enter in say employee ID. If that employee exists than user bring its record else create a new record.
What I did is start in query mode, when user enter employee ID, I check to see if record exist, if it does then I just use EXECUTE_QUERY. Now I don't know what to do for new record. If I use CREATE_RECORD that doesn't work because form is in query mode. How can I make form come out of query mode programmically?
I am using Form 5. Trigger I am using is KEY_NEXT_ITEM in Employee ID field.
Need urgent reply
Thanks

Well Faisal, I have tried this code on the EMP table in the user Scott. I think it will solve your problem
use the key-next-item trigger
declare
empid emp.empno%type;
begin
select empno into empid
from emp
where empno = :empno;
clear_block(no_validate);
set_block_property('emp', default_where, 'empno=' | | empid);
execute_query;
set_block_property('emp', default_where, '');
next_item;
exception
when no_data_found then
next_item;
end;

Similar Messages

  • FRM:41361 Cannot navigate out of form in 'Enter Query Mode'

    Hi,
    I am using a master - detail block in my form.When I query the master block I am getting this error message
    FRM:41361 Cannot navigate out of form in 'Enter Query Mode'
    I have given DO_KEY('ENTER-QUERY') in WHEN-NEW-BLOCK-INSTANCE trigger of master block.
    and in property palette of Master block I have given the next navigation block as Detail block.
    According to the value which is queried in Master Block the Detail block should be populated.
    My form should open in 'Enter Query Mode'.This problem always happens from second time onwards
    I open the form.When I open the form first time this problem is not occuring.
    Can anyone suggest a solution for this
    Thanks,
    Nasiya

    Have you written a Key-EntQuery trigger at the Master block or the form level,
    If yes, then can you put that code here.
    The NEXT-NAVIGATION-BLOCK is only used for navigation when you use a next-block built-in on a key-trigger.
    Have you written a ENTER-QUERY command on any trigger that fires prior to the said WHEN-NEW-BLOCK-INSTANCE trigger?
    If yes, then thats the reason that the first time you run the form, your form is in ENTER-QUERY mode.
    Also, maybe execute on enter-query fails and hence the blocks are not getting populated.
    Also, ENTER-QUERY is always on a single block. And while the block is in enter-query mode, navigation out of that block is prohibited.
    you have to either have a successful EXECUTE-QUERY or use:
    EXIT_FORM(NO_VALIDATE) to come out of ENTER-QUERY mode.

  • Calling another form when current form is in query mode

    I have a form that is in query mode. When I select a menu option that calls another form through new_form, I get the error 'FRM-41009: Function key not allowed. Press Ctrl+F1 for list of valid keys.'
    I would like trap this error, cancel the query and invoke the new form. I have tried to do this by code similar to this:
    if :system.mode = 'enter-query' then
    exit_form ;
    end if ;
    new_form('someform') ;
    (since exit_form in query mode is supposed to cancel the query).
    But in this case, the trigger ends with the execution of the 'exit_form' statement.
    Any help would be greatly appreciated.
    Thanks and regards,
    Rajesh Jayaprakash
    [email protected]

    I think the following will work:
    When you call the EXIT_FORM builtin, Forms cancels out of Query Mode but also stops the current PL/SQ execution - which is annoying.
    I believe, though, that the WHEN-WINDOW-ACTIVATED trigger will fire on your Form. Therefore, you can:
    1) Set a Global Variable or PL/SQL packaged variable just before you call the EXIT_FORM builtin then
    2) Test the value of the Global Variable in the WHEN-WINDOW-ACTIVATED trigger and perform the CALL_FORM there.
    3) Even better, put the CALL_FORM and associated parameters into a Program Unit on the Form - then you can call it from either the original trigger or the WWA trigger as necessary.
    If this does not work, you could resort to:
    1) Set a Global Variable just before you call the EXIT_FORM builtin
    2) Initiate a TIMER
    3) Call the EXIT_FORM builtin
    4) In a WHEN-TIMER-EXPIRED trigger, check the value of the Global variable. If it's set, Call the Form you want to call
    5) Again, put the actual CALL_FORM in a Program Unit so it can easily be called with the correct parameters from wherever you need to call it.
    It's annoying that you need to go to these lengths to perform what seems to be such an easy task!
    If anyone knows any better ways of achieving this, please add another reply!

  • Set search text when form is in query mode

    Hi forum members,
    is it possible to set the value of a textfield when a form is in query mode?
    In our form you can enter query mode with F7 and execute the query with F8.
    When you go back to query mode with F7 and then press F7 again, the search criteria of the past query appears.
    Now in our form there is an alternativ search, that can be executed in query mode with F9. A different search canvas appears then with a more detailed search.
    When I go back from that canvas to the initial canvas, change to query mode with F7 and try to get the last search criteria with F7, not the last search criteria (from F9 search) appears, but the first one (F8 search).
    I have tried to copy the search value into an invisible textfield and then copy it back to the search field when F7 is pressed after the alternative search canvas was closed.
    Instead of appearing in the search field, a new record is created in background.
    Is there any other way to set the value of a textfield in query mode?
    Thanks,
    Marco

    Hi Craig,
    thank you for this hint.
    Unfortunately it does not solve my problem.
    My goal is to fill the search fields with values when they are in query mode.
    I try to explain it step by step:
    Step 1
    - In my Form I change to query mode with F7.
    - I fill a search field, e.g. Name: TIGER.
    - Then I execute the search with F8.
    - Record is displayed in the block
    Step 2
    - I press the F7 Button to change to query mode again
    - Now when I press F7 again, the search values from the last search (TIGER) appear (I think it is a standard forms functionality, isn't it?)
    - I execute the search with F8
    - Record is displayed
    Step 3
    - Again I change to query mode with F7
    - I fill the search field (this time Name: SCOTT)
    - Now advanced search is executed with F9
    - A special search canvas opens over the form with result records and more detailed information to the result
    - I close the search canvas
    Step 4
    - Again I change to query mode by pressing F7
    - I want to get the search value from the last search (SCOTT) by pressing F7 again
    - Value from the first search appears (TIGER)
    My goal is to save the search value from step 3 anywhere (in a variable or copy field or something) and get it back in step 4 when the form is in query mode.
    It seems to me that it is not possible to fill fields that are in query mode, is that right?
    Thanks a lot!
    Marco

  • How do I set form automatically in query mode

    Hi !
    I have to pass value of one field as parameter from one form to
    another form and then execute the query on the next form based
    on the passed value of the parameter. (all this should happen as
    soon as I press one button on the first form).
    My problem is that unless I put the second form in the enter
    query mode before accepting the value of the field, whatever
    value I pass on from the first form will not be of any use.
    How do I set the mode of the form to query mode. Since
    system.mode is the read only variable and no value can be
    assigned to it, so how can I handle this situation ?
    Thanks in advance,
    Shobhit
    null

    Hi Shobhit,
    Try ENTER_QUERY command in the PRE-FORM trigger of second form.
    EXECUTE_QUERY in WHEN-NEW-FORM-INSTANCE and set the parameter
    values to the respective fields in PRE-QUERY trigger.
    Lalit
    Shobhit Kumar (guest) wrote:
    : Hi Steve !
    : Thanks for the answer. but I want a bit different
    functionality.
    : I have already tried using execute-query (built in) in the when-
    : new-form-instance and passed the value of the parameter in the
    : field. But all that is happening is that the value is just
    : sitting in the field and query is not getting executed
    : automatically. I am using forms 5.0 and to enter a query we
    need
    : to change the mode of the form in the query mode (by clicking
    : the enter->query button) and then enter the values in the
    fields
    : that would be used to build the query and the as soon as I say
    : execute query it executes the query and displays the results.
    : What I want is that as soon as I press a button in a form,
    value
    : of one field should go to another field in a second form and
    : then the query should get executed automatically in the second
    : form and the results should be displayed in that form.
    : Any suggestions ?
    : Regards,
    : Shobhit
    : Steve (guest) wrote:
    : : You might want to try placing the builtin EXECUTE_QUERY
    : : in the WHEN-NEW-FORM-INSTANCE trigger to auto query the form.
    : You
    : : may also want to use the SET_BLOCK_PROPERTY(DEFAULT_WHERE,
    : : '.......'); to restrict queried records or set :block.item
    : values
    : : in a PRE-QUERY Trigger.
    : : Shobhit Kumar (guest) wrote:
    : : : Hi !
    : : : I have to pass value of one field as parameter from one
    form
    : to
    : : : another form and then execute the query on the next form
    : based
    : : : on the passed value of the parameter. (all this should
    : happen
    : : as
    : : : soon as I press one button on the first form).
    : : : My problem is that unless I put the second form in the
    enter
    : : : query mode before accepting the value of the field,
    whatever
    : : : value I pass on from the first form will not be of any use.
    : : : How do I set the mode of the form to query mode. Since
    : : : system.mode is the read only variable and no value can be
    : : : assigned to it, so how can I handle this situation ?
    : : : Thanks in advance,
    : : : Shobhit
    null

  • I tried to update my ipod touch software update by syncing with itunes and now its in recovery mode?  Is it possible to get it out of recovery mode?  if so, then how?

    I tried to update my ipod touch software by syncing with itunes and it put the ipod into "recovery mode".  Seems like the only option is to restore?  Is there a way to get it out of recovery mode?

    No.
    Once the Device is asking to be Restored with iTunes... it is too late to save anything...
    To minimise loss... Connect to iTunes on the computer you Usually Sync with and Restore from the most recent Backup...
    http://support.apple.com/kb/HT1414
    Restore from Backup
    http://support.apple.com/kb/ht1766

  • TS1369 my "home" computer for my ipad is no longer working, how can i get my ipad recognized on new comp to get it out of recovery mode?

    The original laptop i used to start my ipad broke so i have a new laptop. I cannot upgrade my ipad with the new laptop and i cannot get it out of recovery mode cuz my laptop is not recognizing the ipad. How can i get my laptop to recognize the ipad so i can get it out of recovery mode?

    Hey Dpcupcake,
    If you can not get past the sign in screen on your iPad, you will need to use the steps in this article to recover use of your iPad -
    Forgot passcode for your iPhone, iPad, or iPod touch, or your device is disabled - Apple Support
    Thanks for using Apple Support Communities.
    Happy computing,
    Brett L 

  • My iPhone 3GS 16gb, is stuck in restore mode, downloaded and tried to do a restore multiple times. Keep getting an error The iPhone "iPhone" could not be restored. Unknown error occured (-1). Cannot get it out of restore mode, keeps rebooting!

    My iPhone 3GS 16gb, is stuck in restore mode, downloaded and tried to do a restore multiple times. Keep getting an error The iPhone "iPhone" could not be restored. Unknown error occured (-1). Cannot get it out of restore mode, keeps rebooting!
    I have tried to hold the "home" and "power" button to reboot
    I have tried powering it off
    I have tried, to unplug the cable, hold the "home" button and then plug it in.
    Can't check the SN or warranty, cause it is stuck in restore mode.
    Is the hard drive gone? Should there be something replaced.

    http://support.apple.com/kb/TS3694#error1
    Error 1 or -1
    This may indicate a hardware issue with your device. Follow Troubleshooting security software issues, and restore your device on a different known-good computer. If the errors persist on another computer, the device may need service.
    Usually this is caused by your antivirus or firewall blocking iTunes access to the Internet. It can also occur if the phone is jailbroken or if the computer you are using was ever used to jailbreak an iDevice.

  • My iphone is in recovery mode and i cannot restore it with itunes on my macbook or my pc. how can i restore my iphone 4s? or at least, how can i get it out of recovery mode?

    i tried to restore my iphone 4s because it kept saying "searching..." for service so i decided to restore it, after having already reset all network settings, and after trying to restore all settings. still, it only said "searching..." for service. finally, i tried to restore my iphone.  when using my macbook, 3/4 through i recieved a message to update my itunes software.  i had to close itunes for the update. when i closed itunes, the iphone restore was in pprogress and having to close the program put my phone into this "recovery mode" with the icon of the usb and the itunes disc logo. i also tried updating and restoring the software with my pc which also didnt work. help?

    Once the Device is asking to be Restored with iTunes... it is too late to save anything... and you must continue with the Recovery...
    kevinpowell1 wrote:
    how can i get it out of recovery mode?
    Make sure you have the Current Version of iTunes Installed on your computer
    iTunes free download from www.itunes.com/download
    Then See Here  >  http://support.apple.com/kb/HT1808
    You may need to try this More than Once...  Be sure to Follow ALL the Steps...
    Take your time... Pay particular attention to Steps 3 and 4.
    Some users have reported as many as 8 or 9 attempts were necessary before success.
    After you have Recovered your Device...
    Re-Sync your Content or Restore from the most recent Backup...
    Restore from Backup  >  http://support.apple.com/kb/ht1766
    If the issue persists...
    Then a Visit to an Apple Store or AASP (Authorized Apple Service Provider) is the Next Step...
    Be sure to make an appointment first...

  • Iphone 5 stuck on connect to itunes screen- if i try and get it out of recovery mode it trys to extract the data and then says the phones memory is full

    iphone 5 stuck on connect to itunes screen- if i try and get it out of recovery mode via itunes,  it trys to extract the data and then says the phones memory is full- cant seem to get it sorted, any ideas? I have an ipad mini if that helps?!

    Hey craigfromsheffield,
    I would suggest that you use the following information in order to help you resolve this issue:
    If you can't update or restore your iOS device
    http://support.apple.com/kb/HT1808
    Thanks for using the Apple Support Communities!
    Cheers,
    Braden

  • The battery of my 2nd gen itouch drained. when i tried to charge it, it's already in recovery mode. how can i get it out of recovery mode without restoring?

    my 2nd gen itouch went to recovery mode after the battery drained. how do i get it out of recovery mode without restoring it? btw, my itouch is not jailbroken and it's on ios4 (don't know which version). thanks!

    you can find softwares like recboot that will remove the recovery mode. you can search it on google
    http://www.google.com.np/search?q=download+recboot&ie=utf-8&oe=utf-8&aq=t&rls=or g.mozilla:en-US:official&client=firefox-a

  • Calling form in Enter-Query mode

    Hi
    how can i Have a form called from the menu (generated with
    headstart) start in Enter-Query mode ?
    Is there any method to do this easily ??
    TIA
    Olivier
    null

    Olivier,
    Look in the Headstart Template Package users guide. In the
    Runtime Behaviors chpt, under Inter-Form Navigation, Named Passed
    Values and Argument Passed Values, you will find an explanation
    of how to start a form in Enter-Query mode.
    Regards,
    Lauri
    Olivier GIBERT (guest) wrote:
    : Hi
    : how can i Have a form called from the menu (generated with
    : headstart) start in Enter-Query mode ?
    : Is there any method to do this easily ??
    : TIA
    : Olivier
    null

  • How to get ipod out of recovery mode without losing media.

    i tryed to update my ipod on another computer and it put it in recovery mode.how do i get it out of recovery mode without losing media.

    If this program does not work then you will have to restore.
    RecBoot: Easy Way to Put iPhone into Recovery Mode

  • How do I get ITunes out of compatibility mode?

    How do I get ITunes out of compatibility mode?

    Try the following document, only be sure that none of the boxes in the compatibility tab are checked (not just the compatibility mode box itself):
    iTunes for Windows: How to turn off Compatibility Mode

  • I was in the process of jailbreaking and updating my ipod and when i was updating it,it went into recovery mode and now i cant get it out of recovery mode so what can i do??

    i was in the process of jailbreaking and updating my ipod and when i was updating it,it went into recovery mode and now i cant get it out of recovery mode so what can i do??

    Go elsewhere:
    Jailbreaking voids the Apple warranty and also means that you will not get any support from Apple, including from this Apple forum. Jailbreaking can't be discussed in this Apple forum.
    Unauthorized modification of iOS has been a major source of instability, disruption of services, and other issues

Maybe you are looking for