Master Detail form in APEX 3.1

Hi,
I am a bit new to the wonders of APEX (Only 1 project behind me).
On my current project I need to make a Master-Detail so I used the APEX template for that. However I have trouble setting my foreign key value in the detail table.
Table setup is like:
TABLE A(col_a pk, col_b)
TABLE B(col_a pk, col b)
TABLE C(col_aa, col_ba, col c)
I want to make a Master Detail between table A and table C. As I said I used the template and everything looks good - however no values are put into col_aa when I push the button to add a new row.
I want to initialize col_aa with the value from col_a when I add a new detail row - but I see no way to do this in a report column.
Can anyone provide me with some hints on how to do this ?
Kind regards
Bo Normann

First, how do you want this interaction to work? If you just put a button at the top of your detail section for creating new detail records, you could trigger this calculation via that button.
If I understand correctly, you don't really need values from the detail report. You need the primary key of the master record. If that's true, then you might try this.
1) Identify the name of the item on your master page that holds the primary key.
2) Identify the name of the item on your detail page that needs to get the value of the primary key from your master form.
3) Set the value of the detail item using a page branch that gets fired by your new record button.
Page branches provide declarative methods to set page items when the branch gets fired.
There are a lot of ways to do what you want. If either of these don't suite your needs you might want to be more specific about how you would like this operation to work.
Earl

Similar Messages

  • Cannot delete record in master detail form in apex 4.0.1

    Dear all,
    I've created a master detail form in apex 4.0.1. Inserting and updating records is working. But when i want to delete a detail or master record, nothing is happening. The delete button is just not working.
    Can someone please tell me if this is a bug, and if so, is there a work around to solve this problem?
    Thanks,
    Diana

    Hi,
    Am I the only one having this problem?
    Thanks,
    Diana

  • Apex - Error in Checksum in Master-Detail Form Page

    The following error message is thrown in a Page with a Master-Detail Form in Apex ,
    ORA-20505: Error in DML: p_rowid=362, p_alt_rowid=ID, p_rowid2=, p_alt_rowid2=. ORA-20503: Current version of data in database has changed since user initiated update process. current checksum = "71064C738DA3DADD5500149404378CFF" application checksum = "0"
         Error     Unable to process row of table "table-name".
    Somebody can tell me what is happening ? Thanks.

    Please check this thread ORA-20505: Error in DML : ORA-20503: . There is a detailed discussion on the same error.

  • Apex Master Detail Form error

    I have created a master detail form. Detail table's primary key consists of 3 columns. When i am updating anything it gives the following 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 = "BC743AF059FDFE4F2814A5EF2A03AC84", item checksum = "7B54748980DD8AB6BF30D538843F520F"., update "APEX_DEV"."V_DATA_STRM_VLDT_CNFG" set "VLDT_SEQ_NUM" = :b1, "DATA_STRM_SID" = :b2, "VLDT_TY_SID" = :b3, "VERI_CTG" = :b4, "LAYT_DEPN_I" = :b5, "REC_FLD_SID" = :b6, "BG_EFF_D" = :b7, "END_EFF_D" = :b8, "CRE_USR_ID" = :b9, "CRE_TMST" = :b10, "UPD_USR_ID
    Can any body tell me what's wrong with the form ?
    Thanks in advance.
    Best Regards,
    Prakash

    Prakash,
    The built-in master-detail forms in APEX currently only support primary keys with one or two columns. Also, neither one of you primary columns can be part of a foreign key. We're considering extending this in APEX 4.0. Until then, you will have to write your own update routines as a page process on the master-detail page.
    Regards,
    Marc

  • Master detail form Error in mru internal routine: ORA-20001

    Hi,
    i created a master-detail form with apex standrad wizard.
    Master e datail are on the same page.
    All works fine.
    My detail form contain some fields of my detail table.
    Now i added a link on detail form for call a form with all fields of my detail table.
    The link work fine.
    When i try to add row or update my detail form i receive the 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 = "D472A2BF636CA11122F196B8A32B3DC8", item checksum
    Any help?
    Thanks in advance
    Lukx

    Lukx,
    I've just reproduced your what I believe you wanted and didn't receive any errors. Here are the steps I took.
    1) Used the wizards to create a Master Detail form (with Detail edit on the same page as the master and only showing 2 of the detail columns)
    2) Used the wizard to create a FORM ON A TABLE for my detail table allowing the user to edit all detail columns
    3) Created a "column link" column on the detail form of the Master Detail form which links to the FORM ON A TABLE, passing across the ID of the detail record.
    When I do this, everything seems to work perfectly as expected.
    Is there something I'm missing in the steps you performed to create your scenario?
    Thanks
    Doug
    http://www.sumneva.com

  • Master Detail Forms with 2 composite primary keys - Is there a workaround?

    Hello All,
    I have been searching for a workaround to the maximum 2 part primary key restriction on the multi-row updates, and master-detail forms, and am hoping that someone can help me. I am using HTMLDB v2.0.0.00.49 with IE 6 against a 9.2 DB.
    I successfully implemented the workaround of Fred Stoopendaal's (see Updata PK on HTML DB ) and it works fine for single page multi-record updateable forms, but alas I haven't been able to extend it to master detail forms (I think it is something to do with Oracle not allowing the "returning" clause on views).
    Here is what I tried:
    two tables, one with a 2 part composite primary key, which is the master table, and a detail table with 3 part composite primary key -
    --------- BEGIN SQL ---------
    create table master_table
    ( master_col1 number
    , master_col2 number
    , master_col3 varchar2(30)
    , constraint master_pk primary key (master_col1,master_col2));
    create table detail_table
    (detail_col1 number
    ,detail_col2 number
    ,detail_col3 number
    ,detail_col4 varchar2(30)
    , constraint detail_pk primary key(detail_col1,detail_col2,detail_col3)
    , constraint master_detail_fk foreign key (detail_col1,detail_col2) references master_table(master_col1,master_col2));
    create or replace view v_master_table as
    select rowid mata_rowid,mata.*
    from master_table mata;
    create or replace view v_detail_table as
    select rowid deta_rowid,
    (select rowid from master_table mata where mata.master_col1 = deta.detail_col1 and mata.master_col2 = deta.detail_col2) deta_mata_rowid
    , deta.*
    from detail_table deta;
    create or replace trigger mata_ins_upd_trg
    instead of insert or update on v_master_table
    referencing new as new old as old
    for each row
    begin
    if inserting then
    insert into master_table (master_col1, master_col2, master_col3)
    values (:new.master_col1, :new.master_col2, :new.master_col3);
    end if;
    if updating then
    update master_table
    set master_col1 = :new.master_col1,
    master_col2 = :new.master_col2,
    master_col3 = :new.master_col3
    where rowid = :old.mata_rowid;
    end if;
    end;
    create or replace trigger deta_ins_upd_trg
    instead of insert or update on v_detail_table
    referencing new as new old as old
    for each row
    begin
    if inserting then
    insert into detail_table ( detail_col1, detail_col2, detail_col3, detail_col4)
    values (:new.detail_col1, :new.detail_col2, :new.detail_col3, :new.detail_col4);
    end if;
    if updating then
    update detail_table
    set detail_col1 = :new.detail_col1,
    detail_col2 = :new.detail_col2,
    detail_col3 = :new.detail_col3,
    detail_col4 = :new.detail_col4
    where rowid = :old.deta_rowid;
    end if;
    end;
    --------- END SQL ---------
    Then I created a master-detail form in Apex on the two views, using the mata_rowid and deta_rowid as primary keys, and mata_rowid=deta_mata_rowid as the link. I realise that using a function to fetch the master rowid within the detail view query is costly, but it was my intention to modify the record fetch queries to use the real FK columns once things were up and running.
    It seems to generate the pages ok, and I can insert/update master table records, but as soon as I modify records in the detail table things go a bit haywire. I can't find any documentation on how the inbuilt MRU/MRD logic works, so can't figure out the issue.
    Can anyone out there tell me what the problem is with the logic above, or if they have come up with a neat solution to this annoying limitation. I know that many will say that I should modify the data model to use surrogate primary keys, but many of the uses for HTMLDB are new interfaces for old schemas, so a workaround that doesn't involve wholesale data model changes would be preferable.
    Thanks in advance,
    Mike Cretan

    Hi, this is likely not the most elegant way...but perhaps the simplest -- and I didn't have much time to play.
    I used Wizard to create two separate Master Detail forms, each with a separate detail table. Thus I ended up with four pages:
    Page "A" - "Selector" page for Master (Report), with Edit link driving to Detail-1
    Page "B" - Editable Master/Detail-1 page (HTML / Report)
    Page "C" - "Selector" page for Master (Report), with Edit link driving to Detail-2
    Page "D" - Editable Master/Detail-2 page (HTML / Report)
    Then I selected the primary key column TWICE on the Report on Page A. Modified the second instance of this column to navigate to Page D (passing primary key) exactly the way the original instance of this column navigates to Page B. Then I deleted Page C.
    Since you can have only one Tabular Entry form per page, this seemed the best way to drive two separate detail tables from a common interface.

  • Primary key updation in the Master details form.

    Hi All,
    I am struggling with Master Detail form in apex 3.12.
    I have two tables.
    SaleMaster ( TRN_ID as PK ) Created from Sequence.
    SaleDetail ( TRN_ID , TRN_TYPE as PK) TRN_ID FK from SaleMaster , TRN Type is user Input in SaleDetail.
    What is best simple way to create the master details form for the above master details tables.
    Thanks.

    I found a way. I dont like it - but it works.
    I made a column link in the detail with the following:
    javascript: doSubmit('NAVIGATE@#ROWNUM#);
    This way I obtain information in the :REQUEST object about which row was clicked.
    In a After submit process on the page I then parse this :REQUEST object like this:
    DECLARE
    v_row NUMBER;
    v_pos NUMBER;
    BEGIN
    v_pos := instr(:REQUEST,'@',-1);
    v_row := substr(:REQUEST, v_pos+1);
    IF APEX_Application.g_f02(v_row) IS NOT NULL THEN
    :P_PRIMARY_KEY_ID:= APEX_Application.g_f02(v_row);
    ELSE
    :P_PRIMARY_KEY_ID:= -1;
    END IF;
    END;
    I know that my "Id" column is named f02 in the form, so this way I can find the id. I then assign this id to a kind of global variable - on the page I redirected to I can now find the Id.
    Talk about ugly code :P

  • 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 with multiple children

    Hi,
    I have managed to create a Master - Detail form in APEX with 2 child tables. For evey parent it brings back the associated child records from the
    2 tables in 2 regions.
    I am having a problem with the Add Row buttons. I copied the button from region 1 ( child 1) to region 2 (child 2). Re-named them (AddRows2).
    When I hit hit Child2 Add Rows, it adds the row to Child 1 region. I suspect it's got something to do with the MRU Process, so I created another
    one called MRU2, based on button Addrows2/ Child table 2. Seems logical, but it still creates the new record in Region 1 ( Child 1).
    Any ideas or examples,
    Thx.

    Hi,
    I am from the Oracle Forms background too and I have been using Oracle Apex for a while. Oracle Forms is just like client-server application although it uses the Forms servlet to render its Web front-end. I think...if you're really trying to develop true-Web application, you should try to forget such features as "master with many details" in Oracle Forms. Loading all the details in a single page will cause overheads anyway. When you discover more about ajax and such third-party javascript libraries as jquery and mootools, you'll have a different mind of Web development.
    Thanks.
    Andy

  • Can any Oracle Forms developer show what a master-details form is?

    I created a master-detail form in APEX. However, the MD form really made me laugh because I needed to SAVE the master record and the detail tabular form separately. There was one SAVE button associated with the master record and one SAVE button associated with the detail tabular form. A master-detail form should let the user to SAVE the master record and the detail tabular form together - one SAVE button saves everything. This is what we can easily do in Oracle Forms - one master and several details (tabbed). I am just frustrated with all the current thin-client technologies including JDeveloper. I cannot simply tell the users that they need to nagviate between pages many times to finish data entry. It doesn't make sense to have the user requirements to fit the current "limited" technologies.

    Not quite Forms functionality but master detail is shown in the Southwind demo on htmldb.oracle.com studio link.
    The details need the master id, and hence the save is done prior creating details.
    Forms of course relied on top down processing such that the header would be inserted before the details would be.
    I know its not exactly what your looking for but it might be the best you can get..
    Daryl...
    ah those are the days of forms 2.3 and what were they called exit triggers ..

  • Apply "WHERE CONDITION" in "MASTER/DETAIL FORM" in "ORACLE APEX

    Hi to all respected Gurus of this community.
    I have a problem and I hope that there must be solution in this community and I am not aware of that till now.
    I have a master/detail form in Oracle Application Express. Now, I want to apply a where condition in master-form to filter the data as per requirement but I cannot do so.
    There is an option of "Modify Query" in "Query Definition". According to the instructions I am selecting the desired column (HR_Category) in left and providing text string 'M-9' in the right column to filter the data where HR_Category is M-9, and when I press apply changes, it gives me an error that
    "1 error has occurred
       The condition you are adding has caused the query to be invalid."
    Please help how to proceed to apply a where condition.
    Regards
    Muhammad Uzair Awan
    Oracle APEX Programmer
    Pakistan

    uzairmalik wrote:
    Hi to all respected Gurus of this community.
    I have a problem and I hope that there must be solution in this community and I am not aware of that till now.
    I have a master/detail form in Oracle Application Express. Now, I want to apply a where condition in master-form to filter the data as per requirement but I cannot do so.
    There is an option of "Modify Query" in "Query Definition". According to the instructions I am selecting the desired column (HR_Category) in left and providing text string 'M-9' in the right column to filter the data where HR_Category is M-9, and when I press apply changes, it gives me an error that
    "1 error has occurred
       The condition you are adding has caused the query to be invalid."
    Please help how to proceed to apply a where condition.
    Regards
    Muhammad Uzair Awan
    Oracle APEX Programmer
    Pakistan
    Probably a syntax error.  Check the syntax of the new clause very carefully.
    Can you post the query indicating which predicate is the new one?  If you need to change the column and table names for confidentiality

  • How to create a master detail form on same page in apex 4.2.1

    Hi All,
    i need to design a master detail form on same page i am not finding an option in wizard from where i can do that.
    will appreciate your suggestions.
    Thanks

    Hi James,
    I think that Mike is suggesting that you create a SQL View over the table and join together the individual primary key values into a single, unique, pseudo primary key. You can still include the individual columns in the SQL but you can then use this new column as the primary key on a form. However, you would also need to create INSTEAD OF triggers to handle inserts/updates/deletes as SQL will not allow you to update tables through a view. (See: [http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/create_trigger.htm#i2064426] for the Oracle details on this or Re: How to update view resp. table for an example within Apex).
    Ideally, though, you should only really need one key column - is there any need for four?
    Andy

  • Master/Detail/Lookup functionality - ApEx and AJAX vs Oracle Forms

    I'd like to build a master detail form with some lookup functionality and have some of the fields automatically populated. I come from an Oracle Forms and PL/SQL background so I was hoping for some guidance in ApEx and Javascript for how to achieve the same effect.
    If you look at the default Sample Application (DEMO_APP), page 29 has the master record and the corresponding details on the same page.
    The functionality I'd like is:
    1) when a new product is chosen from the Product Name select list, I'd like the Unit Price to be populated.
    2) when the Quantity is updated, I'd like
    a) the Extended Price to be recalculated and
    b) the Order Total to be recalculated
    all before submitting the page. This is pretty trivial in Oracle Forms but I've had limited success with ApEx.
    I've been able to achieve 1) in a single record form but not a tabular form using the techniques from Scott's AJAX generator http://htmldb.oracle.com/pls/otn/f?p=33867:2.
    I've been able to achieve 2a) in a tabular form using the techniques from Vikas in this thread Tabular form with Ajax
    I haven't had any luck getting 2b) to work.
    So, is my wish list possible?
    If it is, I'd appreciate some pointers and/or code. I don't speak Javascript but I can copy and paste ;)
    Cheers,
    Bryan.

    Hi Carl,
    Ok, thanks for the tip - take a look at http://htmldb.oracle.com/pls/otn/f?p=24745 login as demo/demo and edit one of the top orders. This will take you to page 29.
    I've changed the 2.0 Sample Application to allow both the unit_price and the quantity to be overtyped. Each column has the 'Element Attributes' property set to onChange="calcTotal(this)" to call the javascript code.
    This recalculates the extended_price (feature 2a above) but the order total (or the report total) is not affected (feature 2b) - how can I change the code to achieve this?
    If I change an existing line item and choose another product from the select list, I'd like the unit_price and the extended_price to change appropriately (feature 1 above) - having to wait until after the form is submitted is not acceptable to my users.
    Thanks for taking the time to look at this - I really appreciate it.
    Cheers,
    Bryan.

  • To attach a RTF template(Report for printing ) in the master detail form

    I have an application in which I have 3  master detail forms  of which one of the form is a gate pass form . Now this gate pass form has a report region as the detail.
    All that i need help is to print the Gate Pass with few fields as information in the gate pass form , where an image or picture of the visitor is also a filed .
    Now I have created an RTF Template  which is the Gate pass layout with the pic.
    So ultimately I have the application for the gate pass form and the RTF template ready with me .. Fixing this template with the application with a BUTTON called PRINT is the challenge am facing !
    SELECT XVH.GPDATE
           , TO_CHAR(XVH.VISITORTIMEIN, 'HH:MI') VISITORTIMEIN --, (XVH.VISITORTIMEIN )
           , (TO_CHAR(XVH.VISITORTIMEOUT, 'HH:MI'))VISITORTIMEOUT
           , XVH.VISITOR_NAME --, = XVH.PERSON_ID
           , XVH.COMAPANY_NAME
           , XVH.PURPOSE_OF_VISIT
           , (SELECT A.FULL_NAME
                FROM PER_ALL_PEOPLE_F A
               WHERE A.PERSON_ID = XVH.PERSON_ID
                 AND SYSDATE BETWEEN A.EFFECTIVE_START_DATE AND A.EFFECTIVE_END_DATE) To_meet
           , XVH.VISITOR_PHONE
           ,APPS.GETBASE64 (XVH.VISITOR_PHOTO)
      FROM xxcdot.XXBCT_VGPF_HEADER XVH
    WHERE XVH.GP_HEADER_ID =  :P_HEADER_ID
    This is the query for the template ..
    Please help me with this. I am very new to apex and learning it with help of online tut

    Pars I need another Help
    I am working with a master detail form where in the form region i have a Radio group . Lets say the Radio group is
    o Returnable
    o Non Returnable
    o Other
    so when i select Non returnable I want a particular column called
    Line Status to get Disabled .
    I have done that by a dynamic action - using jquery statement (.Disable) .
    Defining the element attributes as Disable .
    Now the problem is that ,, Line status is getting disabled on the selection of Non returnable radio button. but unless and until i dont press the Add row button it does not work ,, else i will have to switch over between the radio buttons to get this action done !!

  • Search on Master Detail form/report

    Hi,
    I noticed that when I created a new application in Apex 4.01 basing the intial page on a Master Detail form/report, I was able to add a search item to the initial page. When I go to add another page with a different Master detail form/report, I did not have any option for adding a search item to the report page. Seems like an oversight?
    I would appreciate any hints as to how to add same search item to my 2nd Master/Detail form/report.
    Thanks,
    Pat

    Me too facing the some problem can some one pls help

Maybe you are looking for

  • Upgrading Oracle forms 6i to 11g

    Hi, We are planning to upgrade our application, currently on oracle forms 6i to oracle forms 11g Would need help to analyze what are the issues we may face after the upgrade has been done. Our team will not be upgrading the forms (upgrade would be do

  • ITunes could not sync contacts because the synch server failed to synch....

    I have a laptop running Windows 7 (professional edition) 64 bit using Outlook 2010 and I get this same daggone message every time I try to synch contacts, calender, or notes (all Outlook 2010)...."iTunes could not synch contacts to the iPhone because

  • Error when trying to open

    I am trying to open an after effectrs project like so app.open(aep); where the variable aep is a file object that was aquired using getFiles on a folder object.  I get the followeing error how can the path not be valid...I never entered a path, I sup

  • Date Picker - only allow future dates?

    Does anyone know of a way to control the date picker to only allow the selection of future dates? I would like to force my users to use the date picker, but will need to shade out or grey-out dates less than sysdate+3. This will be used for schedulin

  • Generate Email on Infotype Changes

    Dear Guru's, I have an issue in generating Email when some changes are done in the HR master. I have done it through Dynamic action and it is working fine. But my problem is that I dont want to generate a message when I perform an Hiring Action as I