LOV , EXECUTE-QUERY, ENTER-MODE ?

when the form load , i execute a query. Then i want to choose from an lov
a value and execute a query for a detail block, however, when i want to update
the queried records, it doesn't work. The query mode has to be in enter mode.
The question is how do we implement the enter mode logic into the lov
button.
Please explain how to do this in detail
null

<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by candace stover ([email protected]):
Hi -
THANK YOU FOR YOUR REPLY
I tried your code , but still does not put me in "enter query" mode to update or insert records on the detail block after your code is executed.
I implemented this in a simple master detail of Dept/Emp. I implemented an LOV to select a JOB so that I would only see the employees within the department that have the JOB I select when I press the LOV button. The LOV returns its value into a parameter called "selected_job".
Here is the code I put in my When-Button-Pressed trigger
if show_lov('job_lov') then
go_block('emp');
set_block_property('emp', default_where, 'where job = ' | | '''' | | :parameter.selected_job | | '''');
execute_query;
-- set block property back so that all queries on this
-- block do not have this criteria
set_block_property('emp', default_where, '');
else
-- execute the default child query
go_block('emp');
set_block_property('emp', default_where, '');
execute_query;
end if;
Hope this helps,
Candace Stover
Forms Product Management<HR></BLOCKQUOTE>
null

Similar Messages

  • Clearing Form when changing from Insert Mode to Enter/Execute Query

    Morning folks,
    I need some help or pointers with a form I am working on. At startup, the form is in Insert mode. I am using Oracle Forms 9i.
    Goal: Clear the form with NO_VALIDATE when User enters an ID in Insert mode and clicks on the Execute Query button(DEFAULT&SMARTBAR Inbuilt Menu)
    The user can do two things when they first open the screen.
    Option 1: Enter the STUDENT_ID and press Tab
    Option 2: Enter the STUDENT_ID and press the Execute Query button (Part of the DEFAULT&SMARTBAR Inbuilt Menu)
    There is a When-Validate-Item trigger on STUDENT_ID to check if the Student ID already exists in the database. If it does, it gives an Error message saying "Student ID found. Please Query the record or enter a new Student ID". This is fine with Option 1.
    The problem arises with Option 2. When I Enter a Student ID in Insert Mode and (thinking I am in Enter Query mode) and press the Execute Query button, I get two messages:
    Message 1: "Student ID found. Please Query the record or enter a new Student ID"
    Message 2: Oracle message "Do you want to save the changes? Yes/No/Cancel.
    Is there a way to stop this *Message 2?*
    Here is what I have done to try and mitigate this situation. I have created a non database field and have called it clear_form.
    In When-Validate-Item I set the field clear_form = 1 when I encounter *Message 1*
    {code}
    if t_record_exists > 0 then
    set_alert_property('ALERT_ERROR',ALERT_MESSAGE_TEXT,'Student ID found. Please Query the record or enter a new Student ID');
    alert_button := show_alert('ALERT_ERROR');
    :clear_form := 1;
    end if;
    {code}
    By creating *Key-EXEQRY* Trigger at Form Level, I was hoping that it would just clear the form. I put some messages and its seems to me that *KEY-EXEQRY* is firing first and then the *WHEN-VALIDATE-ITEM*. Is there a way to have the *WHEN-VALIDATE-ITEM* trigger fire first?
    {code}
    if :clear_form is null then
    execute_query;
    else
    clear_form(no_validate);
    end if;
    {code}
    Thanks!
    Edited by: Roxyrollers on Sep 28, 2012 8:50 AM
    Edited by: Roxyrollers on Sep 28, 2012 9:45 AM

    Having the actual Student_ID column from the table is dangerous, since it is also the key to the student's data. What if the user properly executes a query, showing a student's data, and then wants to look up another student, so keys in the new ID. If he then presses Execute Query, the Form asks "Do you want to save your changes?"
    If the user presses Yes, the new ID becomes the previous student's key.
    It would be better if you put the student_ID field in a control block. Then, the user enters a Student_ID, and presses Execute Query, the query then populates the student's data in the Base Table block. In the B_T block, the actual Student_ID column should be hidden.

  • How to implement enter-query , execute-query in Apex Forms

    Hi,
    I am new to Oracle Application Express. I want to know what is the equivalent of ENTER-QUERY and EXECUTE-QUERY features of Oracle Forms in Oracle APEX? I saw a lot of documentation, but everywhere I found that APEX forms only have 3 database actions, (1) INSERT (2) UPDATE & (3) DELETE.
    Does anybody know how we can do QUERY in APEX Forms? (like we do in Oracle Developer Forms).
    Thanks in advance.

    Oracle APEX is a web/ stateless environment. So you do not have the same functionality/ features as in a Oracle Forms environment which is session/state oriented.
    You can however achieve functionality similar to Enter Query / Execute Query through other means.
    The easiest is to use the Forms with Report wizard. It creates 2 pages, the first one is a report and the other a Form. Clicking on the Report rows takes you to the Form page in Edit mode where as the the Create button takes you to the Form in Insert mode.
    If you want to have the enter-query / execute query on a single page it will require significant effort and skills. Try it when you have acquired some more skills in Apex.
    In APEX , like any other web application, you have to think in the web paradigm and not client-server. Even Forms 11g is essentially client-server like and is session oriented through the forms applet.
    Regards,

  • Enter / Execute Query

    I have a form where a patient ID is entered in the master block. This block is related to two other detail blocks in the same form.
    The user enter's a patiend ID. This ID is to be checked for validity against a ID table. Then the ID is checked against the master table to ensure a record for the patient has not already been entered. If the ID is valid and had not already been entered, the user continues in insert mode and fills in the rest of the details. If the ID record already exists, then the details of the record need to be loaded.
    I have got everything working except the last part. How do I automatically switch from insert mode to execute query mode with the ID entered if it already exists in the table ?

    I think it would be best to enter the ID in a control block. Master default where would be ID = :control.ID Then you can have a when-new-block-instance trigger on master:
    :system.message_level := '5'; -- hides 'query caused no records'
    execute_query;
    :system.message_level := '0';
    if :master.id is null then
    :master.id := :control.id;
    end if;

  • When Press "Execute Query" LOV return Item not showing

    I created a LOV and defined return items.
    In the form I created display items, database property NO and assign variable name which is in LOV.
    When I enter a new record LOV shows the return item but when I am executing query only database record is showing and I want to show the all item even they are in database or not.
    Message was edited by:
    Kamran

    execute query populates only database items. To populate non database items after execute query, use post query trigger.

  • How to implement enter and execute query in ADF

    I am new to ADF and I am trying to create a simple data entry screen in ADF 11g based on a database table. I am looking to implement the equivalent of the Enter Query and Execute Query feature in Oracle Forms. I tried the default operations that are available with the data controls. But they don't seem to have this feature. Can someone help me / point me to how this can be implemented.
    Thanks,
    Srini.

    Thanks Shay. As per your suggestion I have included the Find and Execute buttons for the VO Object and ran the page. I first clicked the Find button and entered by query condition and then clicked the Execute button. At this point I get an error popup asking me to enter values for all the mandatory fields. Am I missing something?
    Regards,
    Srini.

  • Execute query based on LOV

    Hi,
    Is there a special code to execute query based on selecting one of the options by the user in the LOV???? or it is as simple as the following???
    Set_Block_Property('PAYMENT_VOUCHER',Default_Where,'payment_method=:PAYMENT_VOUCHER.payment_method'); >>>> in the search button trigger(WBP):::
    Execute_Query;
    Note that the payment method field has a LOV...

    Tasneem wrote:
    ok..
    I tried to set this thread as answered but cannot!!!! believe me...None of answer you get as Helpful or Correct. ???
    You should read...Before posting on this forum please read

  • Execute Query from LOV

    Hi
    There is a Button that run LOV(Show LOV) ,
    how could make the Form Execute Query According to the user Selection from that LOV?
    Thanks

    hi
    Thank you Rahamath and thank you Joachim
    -Create non database item (Item_A). (As you told me Rahamath)
    -Used the LOV to return the value at non database item
    (Item_A) . (As you told me Rahamath)
    -Create Global variable (g_var). (as you told me Joachim)
    -At the trigger When_Button_Pressed I wrote :
    if show_lov (my_lov) then
    go_block('database_block');
    :global.g_var :=:block.Item_A;
         Execute_Query;
    End if;
    - Create Pre_Query Trigger at database block level
    (as you told me Joachim)
         if :global.g_var is not null then
    :id := :global.g_var,
    :global.g_var := null;
    end if ;
    so finally its work
    Thank you a lot for all of you
    bye
    mahmoud

  • Enter and execute query in ADF

    Hi Experts,
    I am trying to implement Enter-Query/Execute-Query in adf and using Jdev 11.1.2.2.0. I put Find and execute operation on the form. When i press execute button i says me to enter value for mandatory fields. But i am try to execute query not trying to create or update records. In forms we can query on any attribute.
    Please guide
    Thanks

    Enter and execute query in Oracle Forms starts with a simple row by row form for updating a table. When you press the "Enter Query" button, the form clears and the user can enter query by example criteria for any of the fields on the form. Then the user presses the "Execute Query" button, and is back in the update form, but with the data for the first matching row shown.
    Here is a page with some links to articles by Steve Muench that explains some ways to implement this in ADF 10.1.3 - I think these techniques should still work in ADF 11g:
    http://radio-weblogs.com/0118231/2006/02/13.html#a658
    Another way with ADF 11g might be to put an af:query component in one facet of an af:switcher and the update form in the other facet. The Enter Query button on the update form tells the switcher to switch to the query facet, and executing the query also tells the switcher to switch back to the update form.

  • Distinguish between Query mode and Entered Mode

    Hello All,
    Could you please tell me how can i say that if the form is in "Query Mode" or in "Entered Mode". I can proceed with my logic, based on this.
    Ex: If form is in Query Mode, i will check the count of records in database, and try updating them
    If form is in Entered Mode, i will check the count of records in database, and throw an error message saying that, data already exists in data base and you cannot create records.
    Please reply me...
    Thanks in advance
    Aush

    Oracle forms by default also provide this functionality. For e.g by pressing F11 it goes in enter query mode, ctrl+F11 it goes in query mode. By default, a form opens in query mode but we can change this behaviour. Also F11 key etc can be changed by editing the entry in fmrweb.res file.
    But, if are interested in knowing the form mode programmatically, then you can use system.mode variable
    For e.g, do something like
    If :system.mode = 'ENTER-QUERY' then
    <do something>
    end if;
    Hope this helps.

  • Precautions to be taken while changing the Query read mode in PED system

    Dear Experts,
    I got a task to change the Query Read mode for more No. of queries in Production system directly itself.
    Request you to let me what are the steps to be followed/precautions to be taken while changing the Query Read mode in PED.
    one more doubt regarding this.....If i plan to change the Read mode of Query say Q1, how can i come to know weather the Q1 is executing or not executing by that time.
    Thanks in advance for valuable response.
    Thanks & Regards,
    Ramesh - Kumar

    Hello,
    You can change the query read mode in transaction 'RSRT', here are the steps:
    1) Access transaction RSRT and enter the query name
    2) Select the 'Properties' option
    3) Un-check the 'Info provider' setting next to the 'Read mode' --> This enables you to change the read mode of the query --> Execute
    4) Choose the option 'Generate Report' to re-generate the query program
    Hope this info helps.
    Thanks
    Bala

  • 10g Form - first execute query - very slow

    I have the following issue:
    Enter an application
    open a form in enter query mode
    first time execute query is very slow (several minutes)
    every other time it's quick (couple seconds or less)
    I can leave the form, use other forms within the app, come back and query is still quick. It's only the first time after initially launching the app.
    Any ideas what might be causing this?

    We have the same application running in 6i client/server DB-9i in production. We are testing the upgraded application that is 10g forms on OAS DB-10g. We don't have the issue in the current production client/server app.

  • Can execute query be controlled for blocks

    Hi,
    I've 3 blocks in my form. The first and the second block are in query mode, therefore I cannot update, insert, delete values here.
    The third block, I have put on another canvas. So the moment there's data in the second block the third block gets displayed. The user is allowed to enter values only in the third block.
    Since the first and second block are in query mode I've put the execute_query in the W-N-F-I.
    Due to the execute_query in W-N-F-I the 3rd block also starts showing me values, which it shouldn't. It should be a clear block with no values displayed.
    Mainly I want the execute_query to work only for first and second block and not for the third block.
    I tried putting the execute query in pre-block trigger. But it showing me error as Illegal operation for join condition and the forms gets hanged.
    Kindly if you could help on the same
    Thanks for your help in adv.

    I'm not sure I completely understand what you are attempting.
    I've 3 blocks in my form. The first and the second block are in query mode, therefore I cannot up date, in sert, de lete values here.So, for BLOCK1 and 2 you have set the "Query Only" property for each block item to "yes". BLOCK3 allows all DML operations.
    Since the first and second block are in query mode I've put the execute_query in the W-N-F-I.Since, these blocks are Query Only, you automatically query them in the WNFI trigger.
    Due to the execute_query in W-N-F-I the 3rd block also starts showing me values, which it shouldn't. It should be a clear block with no values displayed.Here is where I'm a little confused. Do you have a block Relationship created with BLOCK3 or do you call Execute_Query on BLOCK3 in your WNFI trigger?
    I tried putting the execute query in pre-block trigger. But it showing me error as Illegal operation for join condition and the forms gets hanged.Which data block did you try the Pre-Block trigger? By definition, the Pre-Block trigger does not allow the execution of Restricted built-ins. The Execute_Query built-in is Restricted.
    So the moment there's data in the second block the third block gets displayed. The user is allowed to enter values only in the third block.How did you implement this? What is the code you use to display BLOCK3's canvas?
    So, what happens if you have records in BLOCK3 that relate to a record in BLOCK2? How will your user know this if you start with an empty block? I've confused by the description of your requirement...
    Craig...

  • 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]

  • How to cancel a query when execute query builtin fire and No Records found.

    Hi,
    I am unable to cancel a query when i make query (fire enter-query) then fire (execute-query) and no records found then the form status is enter-query mode. Plz help me that how can i back to normal mode of form.
    here i use the code for coming back to enter-query to normal mode but no results.
         if :system.mode = 'ENTER-QUERY' THEN
    ABORT_QUERY;
         clear_form;          
         END IF;
    thanks in advance....

    Hello,
    I would test the record status of the first record in the block. If this status is 'NEW', then there is no record retrieved, so that you can exit the query mode with exit_form()
    Francois

Maybe you are looking for