Master Detail Form - Problem using built in wizard

Hi There
We are working on Application express 2.2.
We are facing problems for a master detail form using Wizard. The
details are as follows : >>
1) Master table : TS_ENTRY_TXN
trans_id P.K.
2) Detail table : TS_ENTRY_TXN_DETAIL
a)trans_id
b)sub_trans_id Composite P.K.(trans_id,sub_trans_id) & these are
based on sequences.
If i try to build a master detail form using the Wizard, the options
for providing P.K. for master & detail are listed which we used.
As it is a master detail form, we want to carry trans_id to the detail
for updations/insertions which doesn't happen.
The MRU fails with oracle error :
Error in mru internal routine: ORA-20001: Error in MRU: row= 1,
ORA-01400: cannot insert NULL into
("TS_APEX"."TS_ENTRY_TXN_DETAIL"."ENTRY_ID"), insert into
"TS_APEX"."TS_ENTRY_TXN_DETAIL" ( "ENTRY_ID", "SUB_ENTRY_ID",
"SMR_ID", "TASK_ID", "SUB_TASK_ID", "TIME_SPENT", "REMARKS") values (
:b1, :b2, :b3, :b4, :b5, :b6, :b7)
Is there any other way to build master detail wihout wizard.
Could you please suggest us better way to complete this task.

If I'm reading this correctly, then one of the columns in your detail tables' primary key is also the foreign key pointing to your master table? If that's the case, then that's not supported by the wizard. For the wizard generated master-detail form to work properly, you'll have to have a foreign key column in your detail table which is not part of your detail table's primary key.
Hope this helps,
Marc

Similar Messages

  • 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

  • Master Detail form - Problems

    We are facing problems for a master detail form using Wizard. The details are as follows : >>
    1) Master table : TS_ENTRY_TXN
    trans_id P.K.
    2) Detail table : TS_ENTRY_TXN_DETAIL
    a)trans_id
    b)sub_trans_id Composite P.K.(trans_id,sub_trans_id) & these are based on sequences.
    If i try to build a master detail form using the Wizard, the options for providing P.K. for master & detail are listed which we used.
    As it is a master detail form, we want to carry trans_id to the detail for updations/insertions which doesn't happen.
    The MRU fails with oracle error :
    Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-01400: cannot insert NULL into ("TS_APEX"."TS_ENTRY_TXN_DETAIL"."ENTRY_ID"), insert into "TS_APEX"."TS_ENTRY_TXN_DETAIL" ( "ENTRY_ID", "SUB_ENTRY_ID", "SMR_ID", "TASK_ID", "SUB_TASK_ID", "TIME_SPENT", "REMARKS") values ( :b1, :b2, :b3, :b4, :b5, :b6, :b7)
    Is there any other way to build master detail wihout wizard.
    Could you please suggest us better way to complete this task.

    Hi San Mat,
    I would never recommend having a composite PK on any table. Use the sub_trans_id as the PK in its own right and have trans_id as a Foreign Key pointing to the master table.
    However, given your existing table structure, what you need to do is add a Default value for the ENTRY_ID field on the child table that points to the Page Item used for the PK field on the master table (you've said trans_id but do you mean ENTRY_ID??). On the column's Column Attributes page, set Default Type to Item (Application or page item name) and the Default to P1_ENTRY_ID (or whatever the name is of field is on the master table's form that holds the PK)
    When a new row is added to the child table, the ENTRY_ID from the master table is inserted automatically.
    Regards
    Andy

  • Master-detail form problem after upgrading to 4.1

    Hello,
    I have running Apex 4.0.2 instance on 11g2 database.
    After upgrading to Apex 4.1 I have a problem with all Master-detail forms.
    I'm able to open the one but detail region shows error 'failed to parse SQL query:
    ORA-00923: FROM keyword not found where expected'.
    All forms work correctly on 4.0.2 version.
    If I migrate that 'SQL Query (updateable report)' region to 'Interactive report',
    the form works fine on 4.1
    What could be a problem?
    Thanks
    Sasa

    Hi Patrick,
    I tried to make test application (the one master-detail page).
    But when I copy the page from my application to test application, copied page in test
    application works fine and because of that I didn't import test application to apex.oracle.com
    Strange thing is that the column in detail table FAK_ID in the page of original application has
    defined default value (P108_ID) but in the copied page in test application that column doesn't have
    defined default value!?
    I don't know if it's expected behavior...
    Anywav, even if I set default value of FAK_ID column in test application, application works as expected.
    I tried upgrade to 4.1 Apex version for three time but unfortunately I always got the same error in the master-detail page.
    BR
    Sasa

  • Master-Detail form Problem

    Hi,
    I've made a Master-Detail form, but I'm getting a weird behavior... When I query a record from the master block it shows the rocords associated from the deatil block, but if I move to the deatil block and click on any field of the records queried, the block gets cleared and the cursor moves to the first line and enters in insert mode, like if I wanted to insert a new record. This same thing happens when I click on an empty line of the detail block... the rows queried get cleared and it moves the cursor to the first line to insert a new record. I don't want this to happen... When I click an empty line to insert a new record, I want the other records to remain there, not to be cleared from grid... I don't know if that's a property or something, I've checked triggers trying to find something weird, but nothing.
    I want to add that the records are not deleted from the tables, just cleared from the grid.
    Thanks for your help!

    It would help knowing how you have set up your data blocks.  Are they Base Table blocks or do you populate the blocks manually through code?
    If your tables are Base Table blocks, do you have a Releationship created between your Master and Detail blocks?  How many records are displayed in your Detail Block?
    Too many questions...not enough information. 
    Craig...

  • URGENT : Master Detail Form problem

    the senario 1 is :
    i have a (Master --> Detail ---> SubDetail) form
    the Master and Detail Parts are displayed on
    canvas and have relation on block level as well as in
    DB,
    but the third SubDetail part has only db relation and
    it is updated on commit.
    On PostQuery trigger in Detail Part , the related
    information in SubDetail is placed in a temporary
    table (XYZ)
    this temporary table is updated on validation of a
    field in Detail Part.
    The above mentioned process WORK FINE FOR THE FIRST
    TIME , BUT SECOND TIME ON EDITING A RECORD IN DETAIL
    PART FAILS.
    AND GEBNERATE THE FOLLOWING ERROR
    WHEN-VALIDATE-ITEM RAISED UNHANDLED EXCEPTION
    ORA-00600
    --=============================================================================================================
    THE SENARIO 2 IS:
    I have 4 tables
    Invoice_MT = A
    Invoice_detail = B
    INVOICE_EXPENSES = C
    GRN_DETAIL = D
    THE A TABLE HAVE (one to many) JOIN WITH B AS
    WELL AS C.
    THE D TABLE HAVE (one to many) JOIN WITH B
    THE INFORMATION IN C TABLE IS ALSO PLACED IN B
    TABLE AFTER CALCULATION.
    THIS CALCULATION IS DONE THROUGH
    1- ROW AND STATEMENT LEVEL DB TRIGGERS ON C
    TABLE
    OR
    2- ROW AND STATEMENT LEVEL DB TRIGGERS ON B
    TABLE
    WHEN THIS UPDATION IS DONE THROUGH " ROW AND
    STATEMENT LEVEL DB TRIGGERS ON B TABLE "
    THERE INVOLVES A TEMPORARY TABLE (ON COMMIT DELETE
    ROWS)
    WHICH IS POPULATED ON ROW LEVEL AND USED TO UPDATE
    "D" TABLE ON STATEMENT LEVEL.
    THE STATEMENT LEVEL TRIGGER OF TABLE B ALSO
    INCLUDE THE REMAINING ROWS FROM B TABLE WHICH ARE
    NOT UPDATED FROM USER INTERFACE.
    DURING THIS STAEMENT LEVEL PROCESS THE FOLLOWING
    ERRORS RAISED ...
    INTERNAL ERROR CODE ATGUMENTS ORA-00600
    [4521],[2],[132033],[0],[4234644],[4294967295],[4294967295],[]
    INTERNAL ERROR CODE ATGUMENTS ORA-00600
    [4553],[2],[25],[],[],[],[],[]
    THE ABOVE ERRORS ARE RAISED IN DIFFERENT TIMES BUT
    ON SAME STATEMENT

    I don't fully understand what you are trying to accomplish, but if you just need to validate the number entered into MY_ITEM, the "WHEN-VALIDATE-ITEM" trigger is normally used for doing that. If it fails validation, just display your alert message and raise a "FORM-TRIGGER-FAILURE" exception which will leave the focus on the field.

  • Using layout wizard to create master details form

    I was using the layout wizard to create a master details form but for the details portion of the form, only one row of data was displayed. What needs to be done to have multiple rows displayed for the details portion of the master details form? I'm using Forms 9i.

    specify the number of records to display in either the layout wizard or in the block properties.

  • Having problem with creating Master Detail form , please help

    I have to work on a project to create a survey system using APEX, as am new on using this tool , am still facing some problems to finish my job..
    i created Master/Detail form using wizard, the master form is working fine but am when i try to add data using the detail form its giving me error :
    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 = "5F8B1EE5CD3D46437455F43B37B9A6A0"., update "ABA"."ABA_SURVEY_SUBCATEGORY_MAST" set "ASCM_CATEGORY_ID" = :b1, "ASM_SURVEY_CODE" = :b2, "ASSM_SUBCATEGORY_ID" = :b3, "ASSM_SUBCATEGORY_DESC" = :b4
    i tried to go through the posts from others but i still dunno what is this error !!!& how to solve it..
    my master data table have 2 primary keys.. the details data table have 3 primary key all of them using trigger to fire a sequence to get the next_val!!
    am desperate & need help urgently for this ASAP.

    hello
    here is the solution,i hope this might help u.
    go to the code of your button and change write the following
    go_block('name of your master block');
    execute_query(no_validate);
    and in the object navigator make the first item in the master
    block that it should be displayed in the canvas and it must be a
    navigable item too.not a display item.
    thank you
    Zeeshan Ahmad

  • Wizard generated Master-Detail form issues

    The wizard-generated master/detail forms have several severe usability issues when the "Choose Layout" option is set to "Builder master detail with: edit detail as tabular form on same page".
    Some of these issues are:
    - The form has two Apply Changes buttons, one to save the master row and one to save the detail row. Users find this very confusing. If you save the master row changes, any changes to the detail rows are lost and vice versa.
    - The form has two Delete buttons, one to delete the master row and one to delete the checked detail rows. Users find this confusins also. Clicking the lower delete button discards any other changes that were made.
    - The Add Row button also discards any other changes that were made.
    The first two issues are easily fixed. With a few simple changes to the generated page, I can make it so there is a single "Apply Changes" button that 1) saves any changes to the master row, 2) saves any changes to detail rows and 3) deletes any checked detail rows.
    I cannot figure out how to solve the third issue (that the add row button discards any changes). I can make it so the "Add Row" button saves the changes, but this isn't user friendly either; I don't think any changes should be comitted unless the user specifically presses 'Apply Changes'.
    So far, I thought of several ways to possibly fix this but can't get any of them to work. Some of the ideas were:
    1. The 'Add Row' button could run the automatic row processing and MRU processes, but not do a commit untill/unless Apply Changes is pressed. I don't think this is feasible because http is stateless and connection pooling may be used, so we can't have a transaction that spans http requests.
    2. Move the Add Row process to page rendering so that the detail table always has an empty "add row" row thereby making the Add Row button unnecessary. I tried this, but it looks like the add row process was designed to run during the page processing, not during rendering, and it fails with a divide by 0 error when it is run during page rendering.
    3. Use client-side DHTML (instead of the HTML DB add row process) to add an empty row to the html table (i.e. add row button does not do a submit, it is handled entirely on the client). I tried this, but the MRU process fails because it doesn't expect the added row.
    If anyone has any other ideas on how to fix this problem, they would be greatly appreciated.
    HTML DB solves this problem in the SQL workshop create table wizard.
    In HTML DB 1.6, the "Add Column" button does a submit but somehow saves any changes that were entered.
    In HTML DB 2.0 beta, client-side DHTML is used (my approach 3 above).
    Can someone from Oracle share how the HTML DB create table wizard solves this problem?

    Eric,
    Thanks for your feedback. I’ll add your suggestions to our list of tabular form enhancement request.
    The wizard generates a regular form for the master record and a tabular form for the detail records. As you pointed out, it’s quite easy to customize this to your individual needs.
    Unlike regular forms, there’s currently no session state concept for tabular forms, so you either need to write your data to the database, or you will loose any changes if you e.g. paginate. For the same reason, the “Add Row” button and the associated process is generated so that any changes are saved to the database before adding a new row. Of course the MRU process that is executed on “Add Row” can be removed, if that is the preferred behavior.
    A work around would be to code the DML processes for tabular forms manually, and temporary store the data in HTML DB collections to simulate a stateful behavior.
    In HTML DB 2.0 we started adding DHTML features, such as the create table wizard you’re referring to. Some features, like the pull down menus, will be available to be used in your own applications. Other features, like the DHTML tabular form, won’t be available for custom applications in 2.0.
    Regards,
    Marc

  • JTable problem in master detail form

    I've created a master detail form. There is only one Navigation bar for both master and detail. Detail has a JTable component. JTable doesn't get focus when it doesn't have any row and I am uanble to insert new rows. To cope with this problem I've added two new buttons in Navigation Bar to travers to the next and previous iterBinding.
    When I start my form cursor apperas in the first field of master view when I press Next Button nothing happens ( Status Bar should show the next iterbinding/view). I've addes some debug mesgs in iterBindingChanged method of NavitaionBar class and it seems by looking the mesgs that detail/Jtable's iterBinding get focus two times but at last focus has been returned to the master iterBinding.
    Is there any suggestion to solve this problem.
    Regards
    Aamir

    Hi,
    I'm using 1.4.0 for my JClient and, due to the improved focus management provided in the new JDK, I am able to properly manage master-details configuration with only one navigation bar (of course, the JTable must be able to receive the focus, but this also is much easier in 1.4.0...)
    Nevertheless, the solution I found is quite complex and I would happily discard it.
    If you could find a solution that works "naturally" on frames with only one navigation bar, it would be great! I think that the buttons in the nav bar should apply to the "current" iterator binding (the iterator binding for the control having the focus).
    Thanks,
    Adrian

  • Problems in Master-Detail forms when the detail contains LOVs

    I am having problems with master detail forms when the detail contains and lov.
    In my detail form I have a messageLovInput field that returns 2 values (code and description). When the lov window returns both values the messageLovInput disappear from the form.
    This problem happens only when I iterate in the master view and I try to add a record in the detail form.
    If I add a new record without navigation for the master view there is no problem.

    Jode,
    which technology are you using, ADF JClient ? If yes, please provide a step by step description of how to setup a testcase to reproduce the problem.
    Frank

  • Master Detail Form - How 2 update a field in the Detail form using a query?

    Hello,
    I have a master detail form with, each master record having a fixed(6) number of detail records. One of the fields in the detail record is the PART_DESCRIPTION field. I am trying to update this field by querying Table_X. TABLE_X is in the format of (desciption id, description). Description id runs from 1 to 6.
    When the form displays, the PART_DESCRIPTION field for the 6 detail records needs to be automatically populated with the six values of description stored in Table_X. How can this be done?
    Tried using session storage objects, but made no headway.
    Would greatly appreciate pointers on how to go about doing this.
    Thanks.
    Dev

    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;

  • Problem: trying to update all detail rows on pre-commit (MASTER DETAIL FORM

    Hi:
    I got a MASTER DETAIL form... and I need to update every detail row of this form (if the master was updated) before commiting the changes. the problem is that i cannot do that for instance in PRE-COMMIT or ON-COMMIT... it's an "illegal operation". I achieved part of it by coding KEY-COMMIT... but that did not solve the all problem. first take a look of the kind of code i want execute before commiting.
    form trigger key-commit code is is somehow like this:
    DECLARE
    tot_line NUMBER (3);
    line NUMBER (3);
    begin
    IF NAME_IN ('system.form_status') = 'CHANGED'
    THEN
    GO_BLOCK ('DETAIL');
    LAST_RECORD;
    tot_line := GET_BLOCK_PROPERTY ('DETAIL', current_record);
    FIRST_RECORD;
    line:= 1;
    LOOP
    :detail.quant := :detail.quant + 1;
    EXIT WHEN line= tot_line;
    next_record;
    line:= line+ 1;
    END LOOP;
    FIRST_RECORD;
    GO_BLOCK ('MASTER');
    END IF;
    COMMIT;
    end;
    The problem is for instance when the users close form in the "X" button (right top, near minimize form) ... If they do that Forms ask "Do you want to save changes?" ... and with this i do not execute the update of the detail rows...
    But there are other situations when this happens... for instance if EXECUTE_QUERY when i change a record...
    Anyone help?
    Joao Oliveira

    Use PRE-UPDATE trigger (Master block).
    begin
    update <detail_table>
    set quant + 1
    where <detail_table>.<relaition_column1> = :<Master_block>.<relaition_item1>
    and <detail_table>.<relaition_columnN> = :<Master_block>.<relaition_itemN>
    and <detail_block_WHERE>;
    EXCEPTION WHEN OTHERS THEN NULL;
    end;

  • How order by  use in master detail form

    hi master
    sir i have master detail form but show data with out order by
    my need is form show data in order on date
    please give me idea how order by use in master detail form
    thank
    aamir

    Set "Order by Clause" Property at block level
    Cheers
    Gouri Sankar

  • Post-trigger problem in master detail form.

    I have designed a master detail form having two data blocks.
    in detail data block there is a post-query.
    when i tried delete one record in master block
    an error occurred ie
    'frm-40654. Record is updated by another user
    re-query to see changes'.
    in detail block there are 3 non database items.
    when i delete the post-query trigger the record is deleting properly.but the post-query trigger is also needed to display the non database item values. please give me a solution to tackle this problem.

    Hi,
    Even though yout items are non-database items, when you assign a value to them forms sets the block status to "CHANGED".
    Add the following lines add the end of your post-query trigger to reset the block status to "QUERY"
    set_record_property (GET_BLOCK_PROPERTY('YOUR_BLOCK_NAME',CURRENT_RECORD)
    ,name_in('system.cursor_block')
    ,STATUS
    ,QUERY_STATUS
    Hope this helps,
    Hugo

Maybe you are looking for

  • How to restrict the cell selection in JTable based on cell contents...

    Hi all, I have some problem related to table cell selection. I have a table that represets the calendar of some month and year. I have the restriction that at one time only one cell could be selected. Now i want the cell seletion like this, I want on

  • Replication of material from MM to SRM with only pricing info

    Hi, We want to replicate only those  materials from MM to SRM for which prices are maintained in the MM system.Pls let me know how to get this done. Thanks, Manu

  • Executing amadmin command in Unix box.  --*** Urgent*****

    I tried to execute following command on Unix machine: ./amadmin -u uid=amAdmin,ou=People,o=ievesp.net -v -w "password" -s /etc/opt/SUNWam/config/xml/amUser.xml I am getting following error message: Info 112: Entering ldapAuthenticate method! Success

  • Regarding oraclespatial

    iam new to oracle spatial. is oraclespatial and oraclespatial index advisor are one and the same .at present iam working as a oracle8idba on nt. my doubt is that while creating indexes for cities,counites,interstates it is showing odciindexcreate rou

  • Aperture 3.0 Update in "Software Update"

    Just downloaded and installed it. But it doesn't look like a fix for any of the major issues. Haven't tried ti yet but here is a screen grab after the install: [IMG]http://farm3.static.flickr.com/2730/4365011237d5b688b55do.png[/IMG]