Form won't query existing record

I'm creating a User Preferences page based on a table that contains one record per user, with the primary key = user_id.
The form creates the record fine. If I exit the form and get back in, however, it does not fetch that existing record.
The form has:
- An Application Item called GLOBAL_ID
- An Application Computation called GLOBAL ID with:
Computation Point=*On New Instance*
Computation Type=SQL Query
Computation=select f_get_id from dual
- A page Process called Fetch row from SZBRPRF with:
Process Point=*On Load Before Header*
Run Process=Once per Page Visit, ...
Item Containing Primary Key Column Value=*P1_USER_ID*
Primary Key Column=*USER_ID*
DML Fetch Mode=Set Memory Cache on Fetch
Runtime Where=*USER_ID = :GLOBAL_ID*
Success Message=*Fetched record for &GLOBAL_ID.*
- The P1_USER_ID item has the following attributes set:
Source Type=*Database Column*
Source Value or Expression=*USER_ID*
Default Value=*:GLOBAL_ID*
Default Value Type=*PL/SQL Expression*
When I open the page, the success message (Fetched record for +389+ is displayed, but the values are not.
So it looks like GLOBAL_ID does contain the value I want it to contain, at the time the fetch is executed, but the record is not found?
If I enter a value in one of the fields and click on Create, I get a unique constraint error.
I have also confirmed, via SQL*Plus, that the record exists in the database.
I keep thinking the problem is with the P1_USER_ID field, and have tried various combinations, but it still isn't working.
Any suggestions would be greatly appreciated.

Laura - Please change your handle to something easier to read and put your first name in your profile to assist us. Thanks.
Computation=select f_get_id from dualIf f_get_id uses APP_USER to determine the record ID, you should move that item-setting code into the authentication scheme's post-authentication process instead of using an on-new instance computation.
- A page Process called Fetch row from SZBRPRF with:
Process Point=*On Load Before Header*After-Header is a good firing point for ARF processes
Runtime Where=*USER_ID = :GLOBAL_ID*This seems redundant. I'd remove it.
- The P1_USER_ID item has the following attributes set:
Source Type=*Database Column*
Source Value or Expression=*USER_ID*
Default Value=*:GLOBAL_ID*
Default Value Type=*PL/SQL Expression*The ARF process fires way before any form item attributes (like Default Value) are evaluated. Plus, if the PK item is null, the ARF process doesn't fetch anything (the process success message notwithstanding).
I keep thinking the problem is with the P1_USER_ID field, and have tried various combinations, but it still isn't working.I think a before-header computation to set P1_USER_ID is your best bet (as Dimitri suggested). Make sure it fires before the ARF process.
Scott

Similar Messages

  • Creating new records while querying existing record

    Hi,
    I have one master - detail form.
    First i created 1 record. Request ID is the primary key. Now request id generated. For ex.: 10
    Request Id, date, requestor , location, status fields are in header block.
    In lines block, i hv some other fields.. and one field called 'Activity'.
    While creating first record, the activity will be 'New'.
    Then i'll query the record '10'.
    when i'm changing the activity 'New' into 'Upgrade', it should create new record with new request ID.
    How to do this?
    I hv written procedure that, i'm taking field values to local variables. Then assigning the local variable values to field values.
    It is not creating as new record. It overwriting the existing record with new values. Existing record is missing.
    Pl. give steps.
    Thanks
    Kavi

    Hi,
    Okk, you will have to do two things. Create two trigger on block level on which you want to do your changes.
    1. First trigger. (PRE-UPDATE)
    In pre-update trigger u will have to write the complete insert statement into the same table with new req id. like
    DECLARE
    vReqNo DATA_TYPE;
    BEGIN
    SELECT MAX(REQ_ID)
    INTO vReqNo
    FROM your_table;
    INSERT INTO your_table
    (req_no, fields....)
    VALUES
    (vReqNo, :forms_values);
    END;
    2. Create 2nd trigger on block level (ON-UPDATE)
    write in this trigger
    NULL;
    for viewing the inserted record. What u have to do is in ON-UPDATE after null; create one timer NO_REAPEAT.
    and in timer u will have to set the block property to req_id = generated_req_id_from_pre_update_trigger and
    execute_query;
    hope it will work...
    -Ammad

  • Only query on existing form without any changes on the existing records?

    Dear all,
    I am working a brand new form. The form is able to query all the records from the table. However, when I leave the form, it will ask me "Do you want to save the changes you have made?" everytime. I didn't make any changes on the existing records.
    My form only has 2 fields (one with LOV and one without).
    Does anyone know what went wrong?
    Thanks.

    How do you populate your datablock? Do you query one of your values in a Post-Query trigger?
    However you are populating your datablock, Forms is detecting that the status of the Form, Block or Record is changing.
    Also, please let us know your Forms version.
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • Howto use an existing record as template in a create new record form

    hi all,
    I have a table with configuration lines, Currently accessible via a report/form combination. This works fine to create, view & edit data.
    However users often need to create a new record which is 90% like an existing record.
    So what they want is to go to an existing record and use it as template for creating a new record (by clicking a button "create copy from"
    My solution attempt
    -when the button is pressed send users to the normal create form, and prefill some of the items with data from the "template record", after which everything is the same as creating a record from scratch
    What did I try
    - as above redirect user to the "create page" and sent the desired items values via URL Syntax. Failed since I have about 20 items and the button settings won't allow me to add more then 10 (besides it not a pretty sight)
    - Instead of sending via URL I've tried only sending the record id for the template and have a "before header process" load the item values in session state. Failed since the page items are all (load form source each time) since they are database columns
    Constraints for the solution
    - No, I can't go first inserting a copy of the record and then display it in edit mode since the remaining 10% of the record can not to be copied because of table constraints. They have serious constraints, which needs user input.
    - (and no I can't first insert dummy data, that's a poor man's solution)
    - I'd like to reuse the current create/edit form since it contains quite some business rules and constraints. So dubbing the page will put me up with a double load of maintenance in case of future changes in business rules
    I'd appreciate any good clues in solving this requirement
    best regards,
    Geert

    Hi Shunt,
    Not entirely what I wanted accomplished but it held the key.
    Removing the PK wouldn't trigger the DML to respond differently on it's own, since the DML decides the database action based on the request.
    I have the create/edit page working on with a "COPY" request
    This way I can call the page both from the report as the form page.
    When called with COPY request the page is loaded as normal edit except
    - I hide the delete and apply changes button
    - I show the create button
    When the create button is pressed a computation removes the PK
    Since the create button is pressed instead of apply_changes it will indeed perform an insert
    Thanx again for the hint
    Sometimes you need an new perspective
    Geert

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

  • Existing record found in XDO_LOBS, do nothing

    We are trying to use xdoloader to migrate a template file from one instance to another. We used to be able to update the template file in the target instance via xdoloader but this has stopped working. We now see the above message in the log file. Does anyone know what this message means and under what conditions the logic decides that it won't update the template file in the target instance? Does it check names, dates, etc? Log file output is below.
    Thanks.
    LANGUAGE] [en]
    [TERRITORY] [US]
    Calling executeQuery()...
    Target file found in XDO_LOBS.
    Closing ResultSet...
    Closing Statement...
    Entering isUpdateTarget()...
    Creating CallableStatement to call UPLOAD_TEST PLSQL...
    PLSQL query: declare b boolean ;n number ; begin b := fnd_load_util.UPLOAD_TEST(p_file
    id => :1,pfile_lud => sysdate,p_db_id => :2,p_db_lud => :3,p_custom_mode => :4);if (b
    ) then n := 0;else n := 1;end if;:5 := n;end;
    [OWNER_ID] [2]
    [LAST_UPDATED_BY] [1772790]
    [LAST_UPDATE_DATE] [2007-05-03]
    [CUSTOM_MODE] [force]
    Calling executeUpdate()...
    Closing CallableStatement...
    Exiting isUpdateTarget()...
    Existing record found in XDO_LOBS, do nothing.: XXFALSPROJ_en_US.rtf
    Exiting processUpload()...
    Exiting process()...

    We were able to resolve our issue (needed to set CUSTOM_MODE parameter to upper case FORCE)

  • Form does not display all records from table

    Hi guys
    I modified one form that was based on a signle DB table. I removed certain fields from the table and added some extra fields to that table. Then based on the new table I also modified the form and removed the text items related to old fields in the table and added new text items pointing to the new fields now. II have checked all the new items properties and they have don't seem to be wrong or so. But now the problem is the form does not display all the records from the table. before it used to display all records from the table when qureied but not now. It only certain records from the table containing all new data and also old data but the form does not display other records though I don't see any obvious discrepancy. Remember that the before doing the modifications, I have table back for the old, created another table that contained new records for the new fields, and then I inserted the old records and updated the new table data in the new table with these new table values. So this way I have got my new table. Could someone help why the new modified form fails to display all records from the new table updated table though it display some of them successfully.
    Any help will be appreciated.
    Thanks

    hi
    Set the block property of "Query All Records" to "YES"
    hope it will work.
    Faisal

  • Problem in modifying existing records in dbtab

    Hi Experts,
    I am doing a report where I have created two dbtab's , one for data getting saved and
    other for fetching data and modifying exsiting records..
    For eg - let ZABC be the table where I need to insert or update records and ZXYZ is the table where
    I need to fetch and modify existing records.
    Now my probelm is :
    In case of inserting new records (multiple records ) into my dbtab ( ZABC ) its working ,
    but modifying existing records in another dbtab (ZXYZ ) its not wroking !! plz advice !!
    If my select querry for modifying exsiting records is:
    SELECT *  FROM ZXYZ  INTO TABLE ITAB WHERE MATNR EQ S_MATNR.
    *****then its inserting a newline along with the existing records.
    but when my querry is,
    SELECT single *  FROM ZXYZ  WHERE MATNR EQ S_MATNR.
    then its modifying the existing records, but only the first record.
    Loop at itab.
    if sy-tabix  = 1.
    zabc-matnr = matnr.
    zabc-idnrk  = idnrk.
    zabc-budat = s_budat.
    zabc-menge = menge1.
    ZXYZ-menge = ZABC-Menge + MENGE1.
    ZXYZ-BALC  = ZXYZ-Menge   -   MENGE1.
    ELSEIF sy-tabix  = 2.
    zabc-matnr = matnr.
    zabc-idnrk  = idnrk.
    zabc-budat = s_budat.
    zabc-menge = menge2.
    ZXYZ-menge = ZABC-Menge + MENGE2.
    ZXYZ-BALC  = ZXYZ-Menge  -  MENGE2.
    ELSEIF sy-tabix  = 3.
    zabc-matnr = matnr.
    zabc-idnrk  = idnrk.
    zabc-budat = s_budat.
    zabc-menge = menge3.
    ZXYZ-menge = ZABC-Menge + MENGE3.
    ZXYZ-BALC  = ZXYZ-Menge   -  MENGE3.
    ENDIF.
    INSERT ZABC.
    IF SY-SUBRC EQ 0.
    MODIFY ZXYZ.
            IF SY-SUBRC = 0.
              MESSAGE : I002 WITH 'RECORD CREATED'.
                ENDIF.
    ENDIF.
    Please advice
    Karthik
    Edited by: Karthik R on Aug 24, 2009 9:42 PM

    Hi,
    This is because in the second case you are not selecting records into an internal table.
    As a result only the first record which satisfies the where condition is fetched.
    Check if the program goes into the loop when you write second select query.
    KR Jaideep,

  • Want to Dsiable the Existing Records

    hi All,
    i am Using Database 9i and Oracle Forms 6i
    i have a tabular bock of 10 records to Display and it has 4 four Records in the table
    i want to do is when i fetch my Records , the Existing Records(4 Records) will Disable and the Record where my Cursor is (5th Record) will Enable , if 1 Column of the Existing Records will Disable it will be Enough for me
    plzz can any tell me how can i Do this !!
    thnks

    hello,
    this is a commoon request please try to search the forum.

  • Have field map to existing record in table by secondary key

    Let's say I have a person table and a code table.
    person.datastoreId
    person.name
    person.foreignKeyToCodeValue
    code.datastoreId
    code.codeValue
    code is a static lookup table. I want to persist a new Person object:
    personObject.name = whatever
    personObject.code = something
    Obviously, person.code is mapped in the mapping XML to the code.codeValue
    table.
    If I call makePersistent(personObject) it will create a new record in the
    code table, right? if codeValue had a unique constraint on it, is there a
    way, so that it would automatically associate that person.codeValue with
    the existing record instead of creating a new one?
    I know I could do a query to get the codeValue object first and assign
    personObject.code to that, but I'm wondering if there is a way to avoid
    that.
    Thanks!
    Joel Shellman

    Joel-
    You will need to implement this sort of singleton pattern yourself.
    The most common way would be to do something like:
    public class Person
    private Code code;
    public void setCodeValue (String value)
    try
    code = (Code)JDOHelper.getPersistenceManager (this).
    getObjectById (new CodeValue.ID (value), false);
    catch (ObjectNotFoundException none)
    // none exists; make a new one with the specified key
    code = new Code ();
    code.setPrimaryKeyField (value);
    In article <bvtod5$nkp$[email protected]>, Joel Shellman wrote:
    Let's say I have a person table and a code table.
    person.datastoreId
    person.name
    person.foreignKeyToCodeValue
    code.datastoreId
    code.codeValue
    code is a static lookup table. I want to persist a new Person object:
    personObject.name = whatever
    personObject.code = something
    Obviously, person.code is mapped in the mapping XML to the code.codeValue
    table.
    If I call makePersistent(personObject) it will create a new record in the
    code table, right? if codeValue had a unique constraint on it, is there a
    way, so that it would automatically associate that person.codeValue with
    the existing record instead of creating a new one?
    I know I could do a query to get the codeValue object first and assign
    personObject.code to that, but I'm wondering if there is a way to avoid
    that.
    Thanks!
    Joel Shellman--
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • Cube operator and aggregation of measures on existing records

    Hi there,
    I'm using a cube operator with loading type LOAD in order to perform merge on fact table.
    We have following situation
    Record already exists on fact table for customer and product with qty 8.
    Incoming record has qty 2, so tried using cube operator hoping that because aggragtion specfied on qty measure was sum and set to solve cube, new qty would be 10.
    However, looked at sql generated and record simply gets updated with new qty rather than adding new to existing qty.
    I can achieve our aim by simply reading for any existing record and adding new record qty to existing record qty, but was hoping the cube operator would do thi s for me.
    Anybody achivede anything similar using sinmply cube operator.
    Many Thanks

    Do you mean that you want to load the data into the AW using the AVG function instead of SUM? If this is true, are you planning to use AVG as the aggregation operator in the AW as well? Will this give the answer you want? The code currently defaults to SUM for load even if you aggregate the cube using AVG since AVG of AVG is not usually what people want. If you want to do it anyway then there it is possible if you hand edit the XML to add an attribute named AggregationMethod to the CubeMap. E.g.
        <CubeMap
          Name="MAP1"
          Query="SALES_FACT"
          AggregationMethod="AVG">But the simpler way to do it is to define a SQL View that aggregates to the load level using AVG and then map the cube to the view.

  • 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

  • FRM-40208: Form running in query-only mode. Cannot change database fields.

    Hi,
    I am using forms 6i where it is calling a form from a menu in query like call_form(,query_only). Now an error is occurring on call of that form ‘FRM-40208: Form running in query-only mode. Cannot change database fields.’ Though this is been handled to give a certain message from on_error message from a package from library.
    Now the issue is that the error keeps on popping even after the ok button is pressed. There are number of records from the table. How can we handle the error. Any suggestion would be really appreciated!!!
    Regards,
    Rajesh

    thanks Gred but i have resolved the issue. it seems that each row was going into query_only mode (program written such a way). therefore the error was showing even after the OK button. handled the issue from ON_ERROR trigger. anyway thanks for your time Gred!

  • Form in Execute Query Mode

    Hi ALL!
    How can I show a form (created by wizard) with record returned by query?
    To Kelly Cox ([email protected]): You wrote earlier: "There are a couple of posts in the 9iAS Portal Applications Forum that address this requirement.
    --Kelly"
    I still have the request (even after advanced search perfomed): Can you show me the address any of them please?

    Take a look at Portal FAQ (http://otn.oracle.com/products/iportal/htdocs/portal_faq.htm)
    You'll find some details under the 'Building Applications' link.

Maybe you are looking for

  • I'm ready to drop Firefox because Scratchpad repeatedly opens anytime I have to Capitalize anything and at no time have I ever used the Web Developer tool

    Have used Firefox for many years on multiple computers. On the home desktop, anytime you need to CAP a letter, Scratchpad opens instead. Every single time! This is only having on this one computer, none of the others. I have completely uninstalled, c

  • SOL10-6-06 Jumpstart question

    Adding 10-6-06 to our existing Sol10 JS server, have mounted all .iso's lofi and run add_to_install_server for iso's 2-5 to the correct directory, but the jumpstart still stops and asks me: Starting Solaris Install Launcher in Command Line Mode. Plea

  • Internet Explorer Login Problem

    hi all. I explain the problem I'm having. You can see what happens in the following link [http: \ \ desarrollo.expowin.net] This application, as you can see, is being called from a subdomain. Presents no problem as Chome browser, Firefox, Opera and S

  • View Links unecessary queries

    hi My application contains one master and many details. Each details page is located on a different tab page. When the application is run the first page is a search page. Once the correct criteria is provided, the master query is executed using VO.Ex

  • BT Mail has no PUSH option for iPad Air

    I am new to this forum - so sorry if this has been raised before. I have just purchased an iPad Air and discover that BT Mail (@btinternet.com) does not have a "PUSH" option for emails to iPad Air - so you have to "Fetch" emails. Has this topic been