Enter_Query Problem

I have a form that I would like my users to start typing in a field as soon as it opens. When the user hits the "Search" button then a trigger Executes the query. The problem that I am running into is that I put a trigger into the "WHEN_WINDOW_ACTIVATED" event (this was put at the form level). The only thing in the trigger is "Enter_Query".
The reason I did this is so that the user would automatically be able to query without pressing any other buttons.
This worked fine when it was the only window that I was working with. Now that I am trying to have multiple instances of the form things have gotten worse. First of all Oracle does not let you navigate out of a form that is in Query mode, and that is a pain, since my forms are in that mode as soon as they open. The other problem is that when the person navigates away and then back, all of the information from the last query is erased.
What I am now trying to do is to allow the user to enter information in the field then when they press the "Search" button I will:
1) Save the information in that field
2) Enter Query
3) put information back in the field
4) Execute Query
But this is not working for me. I can not seem to get the information back into the field and Query after the Enter_Query command has fired. Can anyone give me a clue as to a way to do this? Hopefully my thoughts are organized enough for someone else to understand my problem :)
Here is the code that I was using in my Button_Pressed event:
:SAVED_ITEM_NUMBER := :CITMNBR;
:CITMNBR := NULL;
ENTER_QUERY(NO_VALIDATE);
:CITMNBR := :SAVED_ITEM_NUMBER;
EXECUTE_QUERY();

Hi Jordan!
Add in the trigger check of a MODE.
IF :SYSTEM.MODE = 'NORMAL'
then
--:SAVED_ITEM_NUMBER := :CITMNBR;
--:CITMNBR := NULL;
ENTER_QUERY(NO_VALIDATE);
--:CITMNBR := :SAVED_ITEM_NUMBER;
--EXECUTE_QUERY(); This command is superfluous.
end if;
I have a form that I would like my users to start typing in a field as soon as it opens. Use When-New-Form-Instance trigger and remove WWA.

Similar Messages

  • Do you want to save changes - appears twice in master-detail form.

    Hello.
    Sometimes ago i wanted "Do you want to save changes" message in my own language.
    So i created trigger:
    if :system.form_status IN ('CHANGED') then
         alert_response := show_alert('CHANGES');
         if alert_response = alert_button1 then
              commit_form;
         elsif alert_response = alert_button2 then
              clear_block(no_commit);
         elsif alert_response = alert_button3 then
              raise form_trigger_failure;
         end if;
    end if;
    I call that trigger in many other triggers like enter_query, ...
    Everything worked fine until i created form with master_detail block.
    The problem:
    I have a form with two blocks. One master, one detail.
    If i change something in detail block, go to master block item and press enter_query problem appears.
    First i get the message "Do you ..." in my language. When i press NO or CANCEL i get again the message "Do you ..." in original (english) language?
    Why is that?
    Should i call my trigger somewhere else and not just in enter_query trigger (for this problem) or is checking form_status not enough?
    Thanks.

    When you create relation, 3 procedures are automatically created for you.
    Check_Package_Failure, Clear_All_Master_Details and Query_Master_Details.
    When you execute clear_block(no_commit) on the master block -
    Clear_All_Master_Details will fire.
    If you check Clear_All_Master_Details you will find following code there:
    Go_Block(curblk);
    Check_Package_Failure;
    Clear_Block(ASK_COMMIT); -- This statement causing "Do you want to save changes" to appear

  • Exit_Form in Enter_Query Mode Problem

    Hi Guys,
    I have written this code in my when_new_form_instance
    Enter_Query;
    now when the form runs its in Enter Query Mode.
    I also have a Exit button on my form with code
    Exit_Form(No_Validate);
    if user runs the form, and without executing the query s/he wants to exit, the exit button is not working. First s/he has to execute the query or cancel the query.
    How can i programatically control this situation on my exit button.
    I dont want to write Exit_Form twice in a button, suggest any other solution pliz.
    Best Regards,
    Imran Baig

    In your Exit button's WBP trigger, do this:If :System.mode = 'ENTER-QUERY' then
      Exit_Form;
    End if;
    Exit_Form(No_Validate);To get the button to work while the form is in enter-query mode, it must be in the same block as the one being queried, or else you must set its Mouse Navigate property to No.

  • Problem when trying to refresh oracle screens with latest data

    hello experts,
    i have one problem,i want to refresh the oracle screen with the latest data from the data
    base.
    It is a two stage process.At first step one user will select a row from the screen and then he will press a button .
    now the second screen will appear and the detail of the employee will be displayed.
    First step has been completed and the data is coming in the second form via parameters and i can see the full information of the employee.
    Now i want to refresh the oracle form i.e. suppose if my dba has made any changes in the oracle table( EMP table) i want that after pressing the refresh button user can see the
    latest data from the database.
    in WHEN_BUTTON_PRESSED trigger i have written this codes.
    enter_query;
    execute_query;
    but they are not giving the expected result.
    And one more thing please suggest whether in the second form i should use database item
    or non database item.
    When i am using database item when i am trying to close second from one pop up is appearing
    and asking that whether i want to save the changes.
    please suggest how can i remove this message from my application.
    Regards
    Anutosh

    Hi,
    what data did you transfer via parameters to the second form ?
    how did you populate the datablock in the second form ?
    Typical solution would be:
    (For my example the block is both forms is named EMP, and is based on the table SCOTT.EMP)
    In Form 1, transfer the primary key-value of the current record to a global or parameter (will use global in my example):
    e.g. you have a WHEN-BUTTON-PRESSED-Trigger with the following code:
    <pre>
    :GLOBAL.EMPNO:=:EMP.EMPNO;
    CALL_FORM('FORM2');
    </pre>
    In Form 2, you have a WHEN-NEW-FORM-INSTANCE-Trigger with code:
    <pre>
    DEFAULT_VALUE('GLOBAL.EMPNO', NULL);
    IF :GLOBAL.EMPNO IS NOT NULL THEN
    GO_BLOCK('EMP');
    EXECUTE_QUERY;
    :GLOBAL.EMPNO:=NULL;
    END IF;
    </pre>
    On block EMP in Form 2 there is a PRE-QUERY-Trigger with following code:
    <pre>
    IF :GLOBAL.EMPNO IS NOT NULL THEN
    :EMP.EMPNO:=:GLOBAL.EMPNO;
    END IF;
    </pre>
    And at last, in your refresh-button would be the following code:
    <pre>
    :GLOBAL.EMPNO:=:EMP.EMPNO;
    GO_BLOCK('EMP');
    EXECUTE_QUERY;
    :GLOBAL.EMPNO:=NULL;
    </pre>
    Hope this helps

  • Problem with "locked records" on Oracle with UTF8

    Hello,
    Can somebody help me with "record is locked by another user" problem on Oracle 10.1.0.2 ?
    Oracle is installed with UTF8 character set, and is running on Windows Server 2003. Whenever I try to edit numeric column I get the message "record is locked by another user". Selecting locks from v_$locked_object view, gets empty resultset - nothing is locked.
    The problem occurs only when I edit numeric columns using client applications like TOAD or my own applications. When I do the same column update by sql query, everything works fine.
    Is the problem connected with client configuration or maybe with UTF8 character set, or Windows Server2003?
    We also have second Oracle 10.1 server on Linux, but with WIN1250 character set, and there's no problems like that.
    Thanks in advance for any help,
    remg

    About the only thing you can do is automatically commit or rollback when the user presses the Enter Query key/button. In your key-entqry trigger, you would need to code this:
    Clear_form(no_validate,full_rollback);
    Enter_Query;

  • Problem with Enter Query

    Hi all,
    I'm facing a problem with the Enter_Query. The problem is when i press F7, all the details in a form (Except primary key i.e.., Document Reference) are cleared (After asking for Do you want to save the changes). When I try to do F8, It is searching for the same Document Reference. When I try to find out the error, I got the description as the function key is not allowed. The Document reference is not getting cleared unless i exit the form. I'm using Oracle 10g, Forms and Reports (6i Version).
    Regards,
    Alok Dubey

    Unless you are using a onetime only where clause then the DEFAULT_WHERE remains as it is a property of the block. This will not be cleared by an F7 unless you explicitly clear it by setting it to NULL.
    Or
    I've misunderstood what you say.
    Are you saying that you have an item that is not being cleared? If so is it on the same block as the one you are clearing?
    Message was edited by:
    MarkyMac

  • Problem in Execute query on non-database block and database block together

    Hi All,
    In my form,i have
    1. First block is Non-database block with one non-database item.
    2. Second and third blocks are database blocks.
    Now the problem is that i want to perform execute-query for all the blocks.
    If the cursor is on the non-database item of 1st block and i clicks on the "Enter-query" then i am getting message " This function can not be performed here".
    If i click on the item of the database block and then clicks on the "Enter-query" and then "execute-query" it's working fine.
    But i don't want to do in this way.
    My cursor will be on the First block only and then it should perform execute-query.
    I am using this non-database item to copy value of this item to the item of the database block item.
    I think i make you understand about my problem.
    I am using forms 10g on Window xp.
    Please help me.

    Hi!
    Simply create a enter-query trigger on the non-database-block:
    begin
    go_block ( 'database_block' );
    enter_query;
    end;If your search criteria is in the non-database-item in the first block,
    you actually do not need the enter_query build-in.
    Just create a execute-query trigger on the first block like:
    begin
    go_block ( 'database_block' );
    execute_query;
    go_item ( :System.trigger_item );
    end;And in a pre-query trigger on the database-block copy the
    value of your seach item into the item you want to search for.
    Regards

  • Call_form from menu when in enter_query mode

    I was wondering if headstart has a setting that allows the user to open another form from the menu even when it is in enter_query mode.
    I can see in the libraries that when a form is closed this mode is checked and exit_form is called twice when the form is in enter_query mode but the call_form procedures do not seem to have this check.
    I am also not sure how to implement this myself, since calling exit_form in a menuitem also exits the piece of code, so any call_form or open_form call is not reached after the first exit_form.
    Has anyone had this challenge before and if so, how did you solve it?
    Thanks
    Message was edited by:
    Wendy Tromp

    Sandra,
    I tried to put the key-exeqry in the template. There's only one problem the key-exeqry is a 'in place of' trigger. When I put the code 'Null;' in the trigger, a generated form without a key-exeqry doesn't work because the 'key execute query' does nothing. A generated form with a key-execute query works fine.
    At the other hand, when I put the code 'Execute_query' in the trigger, a generated form without a key-exeqry works fine, but the other one doesn't.
    Which code should I include in the template-trigger?
    Thanks,
    Martine.

  • Push button in enter_query mode

    Hi all !
    I've got the following Problem in Forms 4.5:
    When i enter the query mode with "enter_query",
    i cant push any other (user defined) button i have placed on the form (other Blocks). Thats my problem....
    It seems, that my buttons have to belong to the "Query-Block" (because if so-it works).
    But i have got some other forms sources - and in these forms the buttons DONT belong to the Query-Block and i CAN push the Buttons in ENTER_QUERY - Mode.
    Please, can somebody can give me e hint .... ??

    Frank: Thats what i thought too -but i saw (in other Sources) that it could be done, but how..
    Eugeniy I Duzhinskiy:
    So, many Thanks to you. It works fine !!!!
    (Its great to see there are some other Forms Users out there :) )

  • URGENT: Parameter Passing Problem

    In Forms 6i I am sucessfully passing parameters from one form to another. The problem is I want the receiving form to execute the query at startup. I cant run execute_query; unless the form is in enter_query mode. In a trigger execute_query cannot be run in Enter_Query mode. So I am stumped. Ideally I wanted to try:-
    -- Initailise Block Items with Parameters --
    Enter_Query;
    :interview.Position_ID := :PARAMETER.p_Position_ID;
    :interview.Candidate_ID := :PARAMETER.p_Candidate_ID;
    Execute_Query;
    Obviously the reasons above stop me doing the above example.
    Please Help

    Hello
    This example is base on the dept table.
    Please try this
    trigger ->WHEN-NEW-FORM-INSTANCE
    :GLOBAL.my_var := 10;
    trigger ---> PRE-QUERY
    SET_BLOCK_PROPERTY('emp', DEFAULT_WHERE, 'DEPTNO= ' ||:GLOBAL.my_var);
    it works fine in my little example put the trigger on Forms level.
    Best regards Patrick.

  • Problem with webutil library in Forms 11g debug (FRM-93652)

    Hi.
    I have a problem when debug a forms in OFM11g, that used.
    the problem is that the forms, in debug mode, raise the error FRM-93652. Only in debug mode.
    I add tha jacob.jar and jacob.dll in the folder ORACLE_HOME/forms/java and Oracle_home/forms/webutil.
    the classpath variable in default.env, has added the jacob.jar file, and in my FORMS_BUILDER_CLASSSPATH Registry variable.
    Can some one help me???.
    Thanks and sorry for my english

    I have the same issue with debug_messages in Forms 11g -- they will not appear. I can, however, run in debug mode and attach the session to Forms Builder 10.1.2.0.2. Thus, when I run in debug mode and check the the Command Line tab under Global/System Variables, DEBUG_MESSAGES is always set to NO regardless of how I set it on the command line. Still works fine in our 10gR2 instances.
    DB 11.1.0.7
    Forms 11.1.1.4
    WebLogic 10.3.4
    AIX 5.3 64-bit
    AIX Java 1.6.0 SR9 FP1
    Client: WinXP JRE 1.6.0_25
    My real issue has to do with a FRM-40734 on EXIT_FORM after ENTER_QUERY or EXECUTE_QUERY have caused the KEY-EXEQRY trigger to erroneously fire -- especially when DO_KEY is involved -- but that's a different and much more problematic story.

  • Problems with LOV+Clear Form +Enter Query

    Hi Friends,
    I have a Master Detail Form which is only query form my
    requirement is as soon as the user presses F9(List of Values) on
    Employee Number then 3 activities should be done.
    1. Clear Form
    2. Enter Query
    3. Displaying List of Values
    Any ideas please let me know
    Thanks in Advance
    Rao Guduru
    null

    Hi Rao,
    Here is solution for your problem.
    in KEY-LISTVAL trigger of the Employee number filed write
    following code
    Begin
    Do_Key('clear_form');
    Do_Key('Enter_Query');
    End;
    in the WHEN-NEW-ITEM-INSTANCE Trigger of Employee number filed
    BEGIN
    If (:system.Mode = 'ENTER-QUERY') Then
    list_values;
    End If;
    END;
    If the Employee number is not the first navigable item in that
    block , then in the first navigable item's WHEN-NEW-ITEM-
    INSTANCE trigger write the following code
    If (:system.Mode = 'ENTER-QUERY') Then
    go_item('EMP1.EMPNO');
    End If;
    Let me know whether it solved your problem or not.
    Regards
    Surendra.
    Rao Guduru (guest) wrote:
    : Hi Friends,
    : I have a Master Detail Form which is only query form my
    : requirement is as soon as the user presses F9(List of Values)
    on
    : Employee Number then 3 activities should be done.
    : 1. Clear Form
    : 2. Enter Query
    : 3. Displaying List of Values
    : Any ideas please let me know
    : Thanks in Advance
    : Rao Guduru
    null

  • Execute Query Problem (Urgent)

    Hi,
    I have created customized horizontal toolbar. There I placed the buttons
    1. Enter Query
    2. Execute Query
    3. Cancel Query
    When I press the Enter Query Button "Go_Block(My_Block) ; Enter_Query ;", it works fine and goes into enter query mode, but when i click Execute Query button "Go_Block(My_Block) ; Execute_Query ;" it does not work and show me the message Press Ctrl+F11 to execute or F4 to Cancel query.
    any solution plz.
    Faisal.

    I am assuming you are using FORMS6i Client/Server (big assumption these days I know but here goes...!!)
    From your reply I think you misunderstood my suggestion!
    When you moved the button into your query block, you discovered the problem! As the button (and current focus) is in the query block, the query can now execute successfully.
    When the button is in the button block with MOUSE_NAVIGATE property set to TRUE, pressing the button will move CURRENT FOCUS back to this block and therefore the query cannot execute.
    You have to set MOUSE_NAVIGATE property on the button to FALSE.
    If you are still struggling, email me to save time!!
    [email protected]

  • Problem in Forms11g

    Hi all,
    Iam migrating the forms6i to forms11g , i have a control block in header with one field, and detail block having fields . Once the Form opens cursor will be in control block field and if user simply pressed the tab data will display in detail and user enters some value in one field in detail and system will clear the screen and cursor will point again in the header. Again if the user presses the tab with out closing the form , data is not displaying in Forms11g. But the same thing is working in Forms6i.
    what could be the problem , i could not understand
    Any solution may be appreciated.
    Thanks in Advance
    GV

    When posting, please provide details.
    <li>What is the complete product version?
    <li>Explain the symptom(s). What do you mean "exit is not working"? Is there an error message? Does nothing seem to happen? Details....
    <li>What is the state of the form when you are trying to exit? In other words, are you in ENTER_QUERY mode? Have any changes to a record been posted? Details....
    And so on....

  • Enter_query and execute_query progrmatically

    I would like to place a button on my form that esential will
    allow the user to press this button rather then hitting F7 and
    F8 to query. The problem is that when you got into enter_query
    mode you can not navigate to another block which then means that
    I when i click my button to execute the query I am not able to.
    It is not feasible to place the button as the same block i want
    to query because of the fact that it displays multiple records
    which means it would display my button 5 times. How can I
    achieve this?
    Thanks
    Spencer Tabbert
    null

    You could use stored procedures and pass a where clause to the
    query_procedure. Oracle's has limitations in handling operators
    in enter_query mode.
    cesar (guest) wrote:
    : Spencer Tabbert (guest) wrote:
    : : I would like to place a button on my form that esential will
    : : allow the user to press this button rather then hitting F7
    and
    : : F8 to query. The problem is that when you got into
    enter_query
    : : mode you can not navigate to another block which then means
    : that
    : : I when i click my button to execute the query I am not able
    : to.
    : : It is not feasible to place the button as the same block i
    want
    : : to query because of the fact that it displays multiple
    records
    : : which means it would display my button 5 times. How can I
    : : achieve this?
    : : Thanks
    : : Spencer Tabbert
    : You should place your button in a control block, maybe in a
    : horizontal toolbar canvas.The button will work for any block
    of
    : your form.
    : If you need an example,you could send me an e-mail.
    null

Maybe you are looking for

  • Vendor down payment request Error

    Hi all,         i created a vendor down payment request using f-47. I had created a tax code for the country "AE" using FXTP. But when in the vendor down payment request it is not picking the tax code,giving the error "Tax code AN for country AE has

  • X201s availabili​ty in the U.S.

    I am looking for a replacement for my X60s. First thing, that came up into my mind was X201s. I looked at the U.S. Lenovo website and found out that I am not able to order it from there; however, on the U.K. website it is available for order. Then I

  • Sponsored classes could not be determined; check grant

    Hi Grants gurus, I'm trying to create a budget document for a grant in T-CODE GM_CREATE_BUDGET, and the system issues the error "Sponsored classes could not be determined; check grant" message no. GRANTMGMT655. Can anybody help me please?? Regards!!!

  • Create choose from list in Report selection criteria

    Hi all, Is it possible to create a choose from list in UDF in a Report selection criteria ? My issue is i just want to create a report using crystal report. In this report contain some parameter which the parameter choose from list value is come from

  • Form wont delete the last record

    Hi All I have the follwoing Form e.g First_name || Last_name || Emp_id The Forms works ok when populating the form and saves,you can delete all the records except for the last record if you delete the last record it's save. Does anyone whan what coul