Master/Detail Form based on view(s) - Bug?

I made a master/detail form that is based on two views, and later master was a view and detail was a table. The form opens OK, but when I click query-button, the following error appears on the screen:
An unexpected error occurred: ORA-01445: cannot select ROWID from a join view without a key-preserved table (WWV-16016)
An unexpected error occurred: ORA-01445: cannot select ROWID from a join view without a key-preserved table (WWV-16016)
When you create a form you are offered three different choices:
1. Form based on table or view
Build a form based on a database table or view.
2. Master-detail form
Build a master-detail form based on two tables or views. <---- ?????
3. Form based on procedure
Build a form based on a database stored procedure
Is it at all possible to use views with master/detail?

View should have a rowid. To create a rowid tables have to have foreign key relation. And also in where clause you should have PK-Field-Name=FK-Filed-Name statement.
null

Similar Messages

  • Master Detail Forms

    Can somebody please explain to me how to set up a Master Detail form using Apex 3.1.0?
    The help system is not very helpful.
    I have a Master table whose PK is based on a sequence.
    I have a Detail table whose PK is the concatenation of the Master table's PK with a VARCHAR2.
    Here is how the form is supposed to work: I enter data on the master and detail sections, click an Insert button and 1 record should go into the master and 1 or 2 records into the detail.
    But now I am on the pages that ask me to choose the source for the PK's.
    The source for the master is easy -- it's the sequence.
    But how do I enter the source for the detail table primary key columns?
    The first part of the PK comes from the same sequence number that the master table is based on, so I do not want the sequence to increment once to populate the master table and again to populate the detail table.
    The second part of the PK comes from a value that was entered on the form.
    So how do I accomplish this?
    Do I choose "Existing sequence" for the first PK source and "Custom function" for the 2nd?
    Or what?
    Thanks for your help. Please be as specific as possible in your answer.

    I tried creating a master detail form using a view of the current date's attendance(from the MASTER table) as the detail table AND and the table of all date's attendance as the MASTER table. If I want just the current date's attendance from the MASTER table..how do I get those records the show in the detail of the form?

  • Master-Detail Form in Form6i Developer

    First of All Hi to all Respected Gurus.
    I am stuck in a very basic element and that is Primary-Key/Foreign-Key relation. I am trying to create a Master-Detail Form based on following structure. Records in Master Table and Child Table are saving (inserting) but Primary Key of Master Table is not saving (inserting) as "Foreign Key" in Detail Table.
    Here is Table Structure(s)
    Master Table Name : MGTC_EDM
    CREATE TABLE MGTC_EDM
    EDM_ID NUMBER, -- PRIMARY KEY
    BILLING_DATE DATE,
    CONSTRAINT PK_MGTCEDM_EDMID PRIMARY KEY (EDM_ID)
    CHILD TABLE : MGTC_EDD
    CREATE TABLE MGTC_EDD
    EDD_ID NUMBER; -- PRIMARY KEY
    EDM_ID NUMBER; -- FOREIGN KEY RELATION WITH MGTC_EDM
    MEM_ID NUMBER;
    AMOUNT NUMBER;
    CONSTRAINT PK_MGTCEDD_EDDID PRIMARY KEY (EDD_ID),
    CONSTRAINT FK_MGTCEDD_EDMID FOREIGN KEY (EDM_ID)
    REFERENCES MGTC_EDM (EDM_ID)
    TRIGGER OF "BEFORE_INSERT" IS APPLIED ON BOTH TABLES TO AUTO-POPULATE INCREMENTAL ID
    IN FORM6I, I'VE APPLIED A 'KEY_NEXT_ITEM' TRIGGER ON BILLING_DATE FIELD OF MASTER TABLE TO COMMIT THE RECORD AND TO MOVE THE CURSOR TOWARDS DETAIL BLOCK
    AND THERE ARE NO MORE TRIGGERS IN THE FORM.
    AS CURSOR MOVES TOWARDS DETAIL BLOCK, RECORD IN MASTER TABLE SAVES (COMMITTED) ON AUTO AND WHEN I PRESS "SAVE" BUTTON TO SAVE THE RECORD IN CHILD FORM DETAIL TABLE ALSO COMMITTED
    BUT WHEN I PRESS F8 TO EXECUTE THE QUERY ONLY MASTER RECORD SHOWS AND NO RECORD SHOWS IN THE DETAIL TABLE. WHEN I CHECKED IN DETAIL TABLE IN TOAD, IT FOUND THAT PRIMARY KEY OF MASTER TABLE (EDM_ID) NOT SAVED IN DETAIL TABLE.
    PLEASE HELP.

    Dear Mr. O.Developer, Many thanks for your reply.
    Yes, I've created relationship. Relationship exist in Master_Block and below is the detail
    Relationship Name = MGTC_EDM_MGT_EDD
    Relation Type = Join
    Detail Data Block = MGTC_EDD
    Join Condition = MGTC_EDD.EDM_ID = MGTC_EDM.EDM_ID
    Delete Record Behavior = Non Isolated
    Prevent Masterless Operations = No
    Deferred = No
    Automatic Query = No

  • Create link in Master Detail form

    Hi,
    I created a master-detail form based on Dept, Emp tables. For each employee, I would like to go to the employee's dependent information (like a master -> detail -> detail situation). Can I create a link on the employee field (empno) so that I can link to my employee-dependent form?
    Kelly.

    Hi,
    I created a master-detail form based on Dept, Emp tables. For each employee, I would like to go to the employee's dependent information (like a master -> detail -> detail situation). Can I create a link on the employee field (empno) so that I can link to my employee-dependent form?
    Kelly.

  • Custom Master Detail form not working In EBS

    Custom Master Detail form not working In EBS
    Hi all,
    I have two custom tables -- 1) XXX_DIE_Headers
    2) XXX_DIE_LINES
    I developed a Master Detail form based on above tables. XXX_DIE_Headers is the Master Block (Single record) & XXX_DIE_LINES is the detail block ( Multi line block ).
    Yes, I used Appstand,Template.fmb for developing this form. The Master block has three fields out of which Two are required fields and i have given initial value for them.
    As i deployed it in APPS(EBS),everything about it is working fine (insert,delete,master-detail behaviour) except querying.
    When i press F-11 , It pops up a message "Do you want to save changes you have made" Choice - yes,no,cancel.
    I don't want this message to pop up.
    The scenario is :- I open the form.( without entering ) Press F11 . The message Pops up.
    Please give me suggession on how to work it around so as form directly goes to query mode ,without popping the message.
    regards
    ravi

    It seems that you are changing a database value in your form, do you have any changes in WHEN-NEW-FORM-INSTANCE???
    what the form is trying to tell you that you have changed something, do you want to save it?
    I suggest you debug your form and see what's happening step by step.
    Tony

  • Unable to View records in a master-detail form

    In a master-detail form, I am not able to view records of the master/detail table
    by accepting the values of the PK of the header table items.
    Please tell me the exact steps, so that I can view the detail table records based on the header table PK items.
    Thanks.

    Yes I wrote the LOV code in a different procedure. Now, the view is showing correctly. But I am now trying to update the viewed records.
    The steps I am following in View Option is as below:
    go_block('header');
    clear_block(no_validate);
    execute_query;
    proc_lov;
    go_block('item');
    execute_query;
    I am unable to commit the changes made in the blocks
    The reason it is showing is : UNABLE TO update.....I saw the display_error.
    The system is trying to update the PK part also..Why....Though PK party is clearly defined in the table as well as property palette. Pl. explain how to go about it. Uregent help is required once again.

  • Is this a bug? master rowid value lost when saving on a master/detail form

    master/detail forms seem to lose the rowid after saving, if the unique identifier is set to ROWID
    to reproduce the problem:
    1) create a master detail form on DEPT/EMP
    -- choose 'Managed by Database (ROWID)' on the 'Define Primary Key' page.
    -- do not include master row navigation (but i don't think this matters)
    -- choose 'Edit detail as tabular form on same page' on the 'Choose Layout' page
    -- include the master report
    2) on the master/detail page, change the conditional branch that returns to the master report page
    -- the normal condition for this branch is request in SAVE,DELETE,CREATE
    -- change it to request in DELETE,CREATE
    3) run the form and save a change
    -- saves fine, session shows the ROWID value is still set
    4) save a second change
    -- change does not save, form reverts to Create mode
    this problem does not occur when using the primary key columns instead of rowid
    see http://apex.oracle.com/pls/apex/f?p=60813:7 for the ROWID version
    see http://apex.oracle.com/pls/apex/f?p=60813:11 for the PK column version

    Hi Saverio,
    Bug *13563808* has been logged to track the reported issue, and a fix will be made available in a future release. Just to clarify, this issue is only arising when the APEX-generated Master-Detail is modified post-generation, so for users who have not modified their Master-Details using ROWID to manage their DML processes, they should not experience this issue.
    In relation to my workaround, my suggestion works in my test environment, which I verified before posting the initial suggestion. Please note that the 'Reset Page' process is, by default, conditional on the "Delete" button being pressed. If you have made further modifications to your Master-Detail page, then this might explain why you're seeing different behaviour to me. You might using the "Debug" option on the Developer Toolbar useful. Viewing the debug information should help you to decipher what's going on/wrong on your page. If you still can't resolve the issue, then the safest option might be to revert the page back to it's original state, meaning the user navigates back to the Report page upon submitting changes to the Master-Detail Form page.
    Regards,
    Hilary

  • Master Details form (LOV based on Detail Column of Join Condition)

    I have created a master detail form where user_id is joining master and details.
    I have created one dynamic lov based on child user_id in detail block to diplay all user who works under current user.
    Problem : When i want to select Insert detail action in detail block the dynamic lov should read the user_id which is going to be inserted when you press Save button. Means as its not getting populated till one click on save button my lov is not getting refereshed.
    Please advice what should i do.
    Thanks
    Bakulesh

    I solved myself by modifing some guru's script from this forum little bit. I am adding here for feedback or use to any.
    htp.p('<script language="JavaScript1.3">
    function getMstFieldValue(form,fieldName)
    var objName = "";
    var tmp = "";
    var dAction = "";
    var sel_idx = 0;
    var cnt = 0;
    var instance = 0;
    var slicedName;
    var fillData = new Array();
    var blkname;
    for(var i = 0; i < form.length; i++)
    slicedName = form.elements.name.split(".");
    tmp = slicedName[2];
    instance = parseInt(slicedName[3],10);
    blkname = slicedName[1];
    //alert("Fld "+tmp+" blk "+blkname+ " instance "+instance);
    if (!tmp)
    continue;
    objName = tmp;
    if (objName == fieldName && blkname == "MASTER_BLOCK")
    return form.elements[i].value;
    function setDetFieldValue(form,fieldName,value)
    var objName = "";
    var tmp = "";
    var dAction = "";
    var sel_idx = 0;
    var cnt = 0;
    var instance = 0;
    var slicedName;
    var fillData = new Array();
    var blkname;
    for(var i = 0; i < form.length; i++)
    slicedName = form.elements[i].name.split(".");
    tmp = slicedName[2];
    instance = parseInt(slicedName[3],10);
    blkname = slicedName[1];
    //alert("Fld "+tmp+" blk "+blkname+ " instance "+instance);
    if (!tmp)
    continue;
    objName = tmp;
    if (objName == fieldName && blkname == "DETAIL_BLOCK")
    form.elements[i].value = value;
    </script>');
    thanks
    Bakulesh

  • Problem in Master Detail form when using ADF table for Detail

    hi,
    jdev version-11.1.2.1.0
    i have create Master detail form using datacontrol drag as ADF Master Form Detail Table.
    Now when i create a new row in Detail table using CreateInsert button a blank new row created on the top of detail table.
    and other row show that data of previous record based on master.
    problem is that i want when i click on createInsert button all row of detail table should be blank and when user fill two or three row then commit.
    Thanks in Advance

    Hi,
    if a detail table has data, then createInsert adds to these. If you want to hide existing rows, create a new View Object instance and set its "Retrieve from the Database" option to "No Rows". The use an af:switcher to change the table shown when the user clicks the createInsert button. There is a bit of coding required to have this use case in ADF, but its mostly declarative. Bottom line is that there is no automated option other than creating new rows in a separate page or dialog if you are bothered by existing rows
    Frank

  • FRM-40654 error in master-detail form while deleting record in detail block

    Hi,
    I am facing an issue in a custom form which is a Master-detail form while deleting a record in detail block. It is giving an error "FRM-40654 Record has been Updated by another user. Re-query to see change". I have checked the record is matching with that in database.
    Can anyone help on this.
    Thanks In Advance,
    Midhun

    Hi jan,
    master block is based on Table "A" and detail block is based on a View "X".
    View "X" definitions includes the tables "A","B","C" etc..
    Now I have tried removing table"A" from view "X", even then the same error is ocuuring but the lock is happening on table "B" instead of "A"
    Thanks,
    Midhun

  • Popup Lov in Master Detail Form

    we are working on a master detail form that is based on orders and products. we can view all products, that are contained in one order.
    In the order part, we can choose a field to be of the type: "Popup Key LOV (Displays description, returns key value)"
    However in the products part we do not get to choose this option. Is there a way to realize that?
    Also we would like the users to be able to add an entry to the popup list, but we cannot find where to edit the popup form.
    regards
    maik and chris

    how can i branch from the popup lov to the insert page?
    also, how can i have the produkt name displayed instead of the product id, after choosing an entry from the popup lov. (in the order part i can choose this as an option, but in the products part, i can't)

  • Master Detail Form is ignoring the 4th join condition

    Hello All,
    I have master detail relationship between two tables with a
    composite foreign key (of 4 columns). I'm creating a master
    detail form in O9iAS Portal 3.0.9.8.0 on these 2 tables
    successfully with no errors. The only thing I have noticed, is
    that the wizard does not populate the join conditions
    automatically in step#3. The form runs Okay but it ignores the
    last condition (i.e., 4th), which means that it brings too many
    details records.
    Any ideas
    Much appreciated if you can CC me: [email protected]
    Hamada Hima

    I had this same problem with master/detail form and 4 join conditions. I opened up a TAR and after several weeks
    Oracle determined this to be a bug and submitted it to developers.
    For a work around, I created a view with two of the join fields concatenated together, then created another md form
    with 3 join conditions and it worked. Good luck.

  • Validating WEBDB2.2 Master-Detail form

    I would like to validate a Master-Detail form using Javascript in WEBDB 2.2. There is the option to validate field/forms in other types of Forms (based on Table/View, based on Query, etc...) but I do not see that option in a Master-Detail Form. Any help would be appreciated.
    Thanks

    If you are on a Portal Version lesser than 3.0.9.8.3, then please try the following to populate
    the PART_DESCRIPTION field.
    Steps:-
    1> Edit the form and go to the Additional PL/SQl section and put the following code in the
    "...after displaying the page area" :-
    declare
    type t_vc_arr is table of varchar2(4000) index by binary_integer;
    l_arr_desc t_vc_arr;
    l_form_name varchar2(200);
    l_form_state varchar2(500);
    begin
    l_form_name := p_session.get_module().get_name();
    l_form_state := p_session.get_value_as_varchar2(
    p_block_name => 'MASTER_BLOCK',
    p_attribute_name => '_FORM_STATE'
    if l_form_state = 'QUERY_AND_SAVE' then
    select description
    bulk collect into l_arr_desc
    from <schema>.table_x;
    htp.p('
    <script>
    var descArr = new Array();
    var Fidx = 1;
    var formObj = document.WWVM'||p_session.get_id()||';
    var fieldName = "'||l_form_name||'.DETAIL_BLOCK.PART_DESCRIPTION.0";
    for i in 1..l_arr_desc.count loop
    htp.p('descArr['||to_char(i-1)||']="'||l_arr_desc(i)||'";');
    end loop;
    htp.p('
    for (var i=0; i < formObj.length; i++){
    if (formObj.elements.name == fieldName+Fidx){
    formObj.elements[i].value = descArr[Fidx-1];
    ++Fidx;
    htp.p('</script>');
    end if;
    end;

  • Trouble Creating a Master-Detail Form

    I am trying to create a Master-Detail Form for two tables: Employee and Employee tools. I am using the wizard to create the form. I am just using the defaults and haven't added any code. The form updates the detail rows fine, but I get an error every time I add a new row. Below is an excerpt of the error. It appears that the Checksum is changing. Since this is generated code, is there a bug in APEX. Any thoughts on how to overcome this?
    Thanks,
    JOhn
    Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-20001: ORA-20001: Current version of data in database has changed since user initiated update process. current checksum = "A884FA378C851786DDFE3A33709CB23C", item checksum = "EF2E77BFA1386ECCC11B7C3B2A464E60"., update "EMPLOYEES"."GLASSES" set "FK_PAYROLL_NUMBER" = :b1, "PURCHASE_DATE" = :b2, "OPTICIAN" = :b3, "COST" = :b4, "CHECK_NUMBER" = :b5

    Hi,
    You can have multiple regions with data from different tables on a single page.
    It all depends on the design of your database and pages, how you're going to solve this. Sometimes you need to create a database view to select data from multiple tables, sometimes you'll just create more than 1 region on your page.
    Just try and play a little with Apex to learn some of the tricks. Also the built-in help is very good. You can select a 2-day developer guide to get a feeling of what is possible.
    Good luck!

  • Master-Details form - integrity constraint

    Hi,
    I have created a simple master-detail form. Master block is based on say Table1 with 2 columns and detail block is based on Table2 with 4 columns.
    When I am trying to create records using this form, I enter data in the Master block and then navigate to the detail block and then enter data. When I press the save button,
    the form throws error message "ORA-02291: integrity constraint (APPS.FK_RECORD_IDENTIFIER) violated - parent key not found"
    When I check the query using Help->Diagnostics->display database error, the insert statement is insert into table2 values (......
    I guess, the form is trying to insert data into table2 first. Since there is no corresponding entry in Table1, hence the error. What should be done, so that the form inserts Master block data into table1 first before attempting to insert data into detail block.
    Regards
    Suresh

    Suresh,
    In the Object Navigator view, check the block order under the Data Blocks section. The Master Block should come first, and then only the detail should come. If its is not like that, then change the order of the blocks by dragging the master block to top of the blocks.
    Regards,
    Manu.
    If my response or the response of another was helpful or Correct, please mark it accordingly

Maybe you are looking for

  • Error at the time of Production order cancellation.

    Hi PP Gurus, The transactions happened when Sales order costing was activated 1. Sales order created 2. Production order creation, release 3. Production order confirmation and QM lot created 4. QM lot cleared with Result recording and UD has taken 5.

  • How do I search my history with an EVO 4G

    I am using mozzilla FireFox and I can't seem to find my history, websites previously veiwed, seriously need help. I have an EVO 4G

  • How can I add the extra fields to a datasource usign "User Exist"?

    Hallo guys, I have a quesiton on an extractor. I want to extend fields for an extractor, and the additional fields come from a third table (for the extractor, there is a view which 2 Tabels inner join.) The third table should have LEFT OUTER JOIN rel

  • What's up with Premiere Elements 8.0?

    Hi Adobe fans, I just got my Adobe Premiere Elements 8.0 last week and I've been trying to get rid of this blue tint that covers every single type of imported media. The wierd thing is that it only appears when I import a picture and a media. As you

  • Timeline- Is there a template for one of these?

    I have a school project that includes a timeline. I have searched online- but the ones on there only offer like 6 events and I need at least 20. If there is not template for one of these, then is there something I can get? Also, I need it to be free.