Master and detail in the same page

db11xe , apex 4.0 , firefox 24 ,
hi all ,
i am trying to insert the master and detail data in one step in the same page :
i have two tables (clients) and (tests_administered)
the client table's region contains theses items
client_id
client_name
the other table's region contains these columns -- the tabular region
row selector
test_admin_id -- pk,  hidden
client_id          -- hidden , this is the one i should populate with values
and more columns
i've done this :
1- removed the condition of the tabular region .
2- Added the request CREATE to the list in condition of the APPLYMRU process -- or :request like ('CREATE')
3- Added new process with following code : -- with sequence before the applymru process and after process row of clients process
for i in 1..apex_application.g_f02.count
loop
apex_application.g_f02(i) := :p2_client_id ;
end loop ;
but nothing happened . why ? what did i miss ?
thanks

Hi,
Create a Master Detail Form through the APEX Wizard 
Make sure you choose the Primary Keys for the Master Detail as one of your Column and not the ROW ID.
Selecting an existing Sequence for the Primary Key is preferred.
Select the option the where your Master and Detail appears in the same page.
Initially when you run the page your master and detail will not appear at the same time in the page when your Master Detail Form is in the entry form mode. For this you have to go to your Tabular Form(Detail Form) region, and below you will have to remove the Condition for the display of your Tabular form and set it to “No Condition”.
Now when you run the page both the Master and Detail form will appear together in the create mode but you will not be able to insert or create both master and detail records at the same time when u click the create button. For this the following needs to be done: You need to create a PL SQL Tabular Form process :
Let's say your master form is based on DEPT and your detail tabular form is based on EMP. Make sure the following things are configured:
The DEPT insert/update DML process runs before the new tabular form PLSQL process. (ie) the new PL SQL Tabular Form Process that you create should be inbetween Automatic Row Processing(DML) and Multi Row Update Process , so create the new Tabular Form Pl SQL process with a sequence number inbetween these two Processes.
Make sure you choose Tabular form while creating this PL SQL process.
The new tabular form PL/SQL process executes the following as the source
   :DEPTNO := :P1_DEPTNO;
Where DEPTNO is the Foreign Key column in the Tabular Form that links the Primary Key Item P1_DEPTNO of the Master Form.
Finally this new PL SQL process conditionally runs when DEPTNO is null, so you need to add the following condition to the process:
The final step to accomplish in creating both the Master and Detail records at the same time is to make a change in the condition of the Multi Row Update Process. :request in ('SAVE','CREATE') or :request like 'GET_NEXT%' or :request like 'GET_PREV%'
-We make this change so that records get inserted into the Detail table when we click the ‘’Create” button.
Now you can Run your page and create both the Master and Detail records at the same time.
Thanks and Regards,
Madonna

Similar Messages

  • Keeping heading and detail on the same page

    Hi, I have a report with a group header section and a detail section.  How can I keep the heading section and all the detail section on the same page without starting each group on a new page?
    The detail section will have either 2 or 3 records with some of the objects set to grow if the data doesn't fit on one line.  This results in several changes of group appearing on the same page which is what I want.  However, what I don't want is the header section on one page with the detail section on the next, or the header and some of the detail records on one page with the rest of the detail records on the next.  What I would like is the report to start a new page if the header and all the detail records don't fit on the same page but without starting a new page for every group change.  How can I achieve this?

    you can put the group header and details into a sub report on the old group header section.
    then hide the details section

  • Insert Master and Detail in the same transaction

    I have 2 view objects : Students and Enrollments.
    Connecting those view objects, there is one view link :
    Cardinality : 1..* (One student can enroll several courses).
    This link is exposed in "Students" view object by the property "getEnrollments" and in "Enrollments" view object, by the property "getStudent".
    I am try to insert records first in Student table, and Enrollment table in the same transaction.
    The primary key for Student table is generatade by a sequence (database trigger)
    My code is :
    StudentListImpl studentView = getStudentList();
    StudentListRowImpl studentRow = (StudentListRowImpl) studentView.createRow();
    studentRow.setFirstname(student.getFirstName());
    studentRow.setLastname(student.getLastName());
    studentRow.setDatebirth(student.getDateBirth());
    studentRow.setStatusid("A");
    studentView.insertRow(studentRow);
    EnrollmentListRowImpl enrollmentRow = (EnrollmentListRowImpl) studentRow.getEnrollments().createRow();
    enrollmentRow.setCourseid("C-100");
    studentRow.getEnrollments().insertRow(enrollmentRow);
    The generated Student ID is not being retrieved by ADF and set up in Enrollment view object. So, database is firing foreign key violation (in Enrollment table - No student ID provided)
    How can achieve this goal? Insert in DETAIL table with the key generated for the PARENT table?

    Yes, ID attribute in Student EO is DBSequence.
    If I insert only Student it works. But when I try to insert an Enrollment for that just created Student (same transaction), the Student ID is not assigned to Enrollment EO.
    The code I use to insert Enrollment is :
    EnrollmentListRowImpl enrollmentRow = (EnrollmentListRowImpl) studentRow.getEnrollments().createRow();
    enrollmentRow.setCourseid("C-100");
    My question is :
    Since I am creating a new Enrollment row using view link acessors in Student VO (getEnrollments), will the Student ID (just generated by sequence) be automatically assigned to Enrollment VO?
    I am totally lost about this (inserting master and detail in same transaction) and I can't find documentation on this topic.

  • Three master detail on the same page

    Hi
    I generate master-detail pages (master and detail in the same page) and it works very well, but I can't generate three master detail (master-detail and the detail with other detail, three levels of tables) on the same page. How can I do it?
    Thanks in advance
    Liceth

    Liceth,
    You cannot generate this. You can add the third level post-generation using drag and drop.
    Steven Davelaar,
    JHeadstart Team.

  • To create an application with a master and two details in the same page

    How I make to create an application contend a form master with two forms details in the same page?
    Tomaz
    Message was edited by:
    user517841

    Hi,
    You do not need to mount a screen. Just add a new region with several text fields inside. You should fetch a row by a process and populate the set when you load the page or click on a button. Insert, update, and delete should be done by processes. You have to have Next and Previous buttons to brows trough all rows of the detail table.
    The most important thing here is what the connections between tables in your database are.
    If they are the "One to many, One to one" you can use the approach described above.
    If they are "One to many, One to many" will be better to use buttons or links to lunch details' tables in separate forms.
    If the second and third tables are connected only to the master table you can use two buttons at the right of every master row. Clicking on the buttons will bring separate form for each detail table.
    If the third table is just a luckup table to the second one you can use "Select List" field into tabular form of the second table in one Master-Detail form.
    Konstantin
    [email protected]

  • Master Detail on the same page PHP - MySQL

    Hi,
    Is it possible to create a page using spry master region and call MySQL data into a Spry detail region, like you do with xml data?
    Basically, is there a way to have master detail regions on the same page without using frames?
    Thanks
    Bert

    Thanks for that, very useful indeed.
    But isn't it going to be slow, first transferring the MySQL data to XML then reading XML to display the records.
    What is the advantage other then displaying master detail on the same page?
    Thanks
    Bert

  • Multiple (updatable) details in the same page.

    Hello,
    I tried to put two updatable details in the same page and got the error
    "Updatable SQL Query already exists on page 11. You can only add one updatable SQL query per page. Select a different page"
    So having more than one updatable detail is not allowed in apex ?
    I have a master table with three details. Should I create one page for each one of them ?
    Thanks in advance
    Bye
    Nicola

    What you want to use are called collections. Here is a simple collection example:
    The process goes in 4 steps: gather the data, display the data, update based on user input, then write the changes. Each step requires it's own piece of code, but you can extend this out as far as you want. I have a complex form that has no less than a master table and 4 children I write to based on user input, so this can get as complex as you need. Let me know if anything doesn't make sense.
    First, create the basic dataset you are going to work with. This usually includes existing data + empty rows for input. Create a Procedure that fires BEFORE HEADER or AFTER HEADER but definitely BEFORE the first region.
    DECLARE
      v_id     NUMBER;
      var1     NUMBER;
      var2     NUMBER;
      var3     VARCHAR2(10);
      var4     VARCHAR2(8);
      cursor c_prepop is
      select KEY, col1, col2, col3, to_char(col4,'MMDDYYYY')
        from table1
        where ...;
      i         NUMBER;
      cntr      NUMBER := 5;  --sets the number of blank rows
    BEGIN
      OPEN c_prepop;
        LOOP
          FETCH c_prepop into v_id, var1, var2, var3, var4;
          EXIT WHEN c_prepop%NOTFOUND;
            APEX_COLLECTION.ADD_MEMBER(
            p_collection_name => 'MY_COLLECTION',
            p_c001 => v_id,  --Primary Key
            p_c002 => var1, --Number placeholder
            p_c003 => var2, --Number placeholder
            p_c004 => var3, --text placeholder
            p_c005 => var4 --Date placeholder
        END LOOP;
      CLOSE c_prepop;
      for i in 1..cntr loop
        APEX_COLLECTION.ADD_MEMBER(
            p_collection_name => 'MY_COLLECTION',
            p_c001 => 0, --designates this as a new record
            p_c002 => 0, --Number placeholder
            p_c003 => 0, --Number placeholder
            p_c004 => NULL, --text placeholder
            p_c005 => to_char(SYSDATE,'MMDDYYYY') --Date placeholder
      end loop;
    END;Now I have a collection populated with rows I can use. In this example I have 2 NUMBERS, a TEXT value, and a DATE value stored as text. Collections can't store DATE datatypes, so you have to cast it to text and play with it that way. The reason is because the user is going to see and manipulate text - not a DATE datatype. If you are using this as part of a master/detail form, make sure that your SQL to grab the detail is limited to just the related data.
    Now build the form/report region so your users can see/manipulate the data. Here is a sample query:
    SELECT rownum, apex_item.hidden(1, c001),  --Key ID
         apex_item.text(2, c002, 8, 8) VALUE1,
         apex_item.text(3, c003, 3, 3) VALUE2,
         apex_item.text(4, c004, 8, 8) VALUE3,
         apex_item.date_popup(5, null,c005,'MMDDYYYY',10,10) MY_DATE
    FROM APEX_COLLECTIONS
    WHERE COLLECTION_NAME = 'MY_COLLECTION'This will be a report just like an SQL report - you're just pulling the data from the collection. You can still apply the nice formatting, naming, sorting, etc. of a standard report. In the report the user will have 3 "text" values and one Date with Date Picker. You can change the format, just make sure to change it in all four procedures.
    What is critical to note here are the numbers that come right before the column names. These numbers become identifiers in the array used to capture the data. What APEX does is creates an array of up to 50 items it designates as F01-F50. The F is static, but the number following it corresponds to the number in your report declaration above, ie, F01 will contain the primary key value, F02 will contain the first numeric value, etc. While not strictly necessary, it is good practice to assign these values so you don't have to guess.
    One more note: I try to align the c00x values from the columns in the collection with the F0X values in the array to keep myself straight, but they are separate values that do NOT have to match. If you have an application you think might get expanded on, you can leave gaps wherever you want. Keep in mind, however, that you only have 50 array columns to use for data input. That's the limit of the F0X array even though a collection may have up to 1000 values.
    Now you need a way to capture user input. I like to create this as a BEFORE COMPUTATIONS/VALIDATIONS procedure that way the user can see what they changed (even if it is wrong). Use the Validations to catch mistakes.
    declare
      j pls_integer := 0;
    begin
    for j1 in (
      select seq_id from apex_collections
      where collection_name = 'MY_COLLECTION'
      order by seq_id) loop
      j := j+1;
      --VAL1 (number)
      apex_collection.update_member_attribute (p_collection_name=> 'MY_COLLECTION',
          p_seq=> j1.seq_id,p_attr_number =>2,p_attr_value=>wwv_flow.g_f02(j));
      --VAL2 (number)
      apex_collection.update_member_attribute (p_collection_name=> 'MY_COLLECTION',
          p_seq=> j1.seq_id,p_attr_number =>3,p_attr_value=>wwv_flow.g_f03(j));
      --VAL3 (text)
      apex_collection.update_member_attribute (p_collection_name=> 'MY_COLLECTION',
          p_seq=> j1.seq_id,p_attr_number =>4,p_attr_value=>wwv_flow.g_f04(j));
      --VAL4 (Date)
      apex_collection.update_member_attribute (p_collection_name=> 'MY_COLLECTION',
          p_seq=> j1.seq_id,p_attr_number =>5,p_attr_value=>wwv_flow.g_f05(j));
    end loop;
    end;Clear as mud? Walk through it slowly. The syntax tells APEX which Collection (p_collection_name), then which row (p_seq), then which column/attribute (p_attr_number) to update with which value (wwv_flow.g_f0X(j)). The attribute number is the column number from the collection without the "c" in front (ie c004 in the collection = attribute 4).
    The last one is your procedure to write the changes to the Database. This one should be a procedure that fires AFTER COMPUTATIONS AND VALIDATIONS. It uses that hidden KEY value to determine whether the row exists and needs to be updated, or new and needs to be inserted.
    declare
    begin
      --Get records from Collection
      for y in (select TO_NUMBER(c001) x_key, TO_NUMBER(c002) x_1,
                 TO_NUMBER(c003) x_2,
                 c004 x_3,
                 TO_DATE(c005,'MMDDYYYY') x_dt
               FROM APEX_COLLECTIONS
               WHERE COLLECTION_NAME = 'MY_COLLECTION') loop
        if y.x_key = 0 then  --New record
            insert into MY_TABLE (KEY_ID, COL1,
                COL2, COL3, COL4, COL5)
              values (SEQ_MY_TABLE.nextval, y.x_1,
                  y.x_2, y.x_3, y.x_4, y.x_dt);
        elsif y.x_key > 0 then  --Existing record
            update MY_TABLE set COL1=y.x_1, COL2=y.x_2,
                 COL3=y.x_3, COL4=y.x_4, COL5=y.x_dt
             where KEY_ID = y.x_key;
        else
          --THROW ERROR CONDITION
        end if;
      end loop;
    end;Now I usually include something to distinguish the empty new rows from the full new rows, but for simplicity I'm not including it here.
    Anyway, this works very well and allows me complete control over what I display on the screen and where all the data goes. I suggest using the APEX forms where you can, but for complex situations, this works nicely. Let me know if you need further clarifications.

  • Form and report on the same page...

    Hi,
    I want to have a form and report on the same page... as soon as user enters the information and submit the form via button then the report should be able to display the addition...
    may I know how to accomplish this...
    Thanks in advance

    Hi
    Can you try like this
    1.First create an empty page and add a html region and template as form region and add the necessary fields to insert into table
    2. create a another region with type as "SQL Query" and template as report region and add the necessary fields for the reports.
    Once u entered the details into form region and created process and insert into table and then automatically the report region query will fetch the recently added row and displays in the report.
    Hopes this might helps you.
    Thanks & Regards
    Srikkanth.M

  • How to show master and detail tables in different pages?

    Hi,
    Can somebody expalin me how to include or bind the master and detail tables to different pages which are included at runtime.
    thnaks,
    Naresh.

    Hello!
    you have ti create a Master/Detail data structure.
    In the first page drag the master table, on the second drag a detail table.
    It should work out of the box. Selecting a record on the master table selects
    the details on the detail table automatically!
    regards,
    Mario Udina

  • SpryValidation and DependentDropdown in the same page

    hi,
    With "SpryValidation" and "DependentDropdown" in the same page
    SpryValidation, on "Submit" event, doesn't work
    Any solution??
    Thanks
    Gabriele

    Hi Gabriele,
    when checking some code located in some file in the "includes" folder, it seems that the onsubmit event is already "captured" by ADDT´s own clientside form validation routines.
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • How do I type Hebrew and English on the same page

    How do I type Hebrew and English on the same page in Indesign?

    What version of InDesign are you using? And on what operating system? Switching keyboard ("input methods") is in your OS, not in InDesign. InDesign has had the capability to display right-to-left languages since CS4, but only the Middle East edition has the abilities to actually manipulate Hebrew text. If you're trying to do a bilingual, bidirectional document, you'll need the ME edition. If you are a CC subscriber, it comes with your subscription; if you are not, you'll need to buy another version of ID, or a plugin that will allow you to access those RTL features.

  • How do I combine text and photos on the same page in iPhoto using photobook

    How do I combine text and photos on the same page in iPhoto using photobook?

    You mean while creating a book in iPhoto?  Click on the layout button while viewing a page and select the layout that includes both text and photos.  Most themes will have those options.
    OT

  • Everytime I try to pay with my cc on paypal, I enter all of my infor and after I press the "review and confirm" button the same page reopens but has erased only my cc #, exp date and security cvv number. What could be wrong?

    b.stats.paypal.com : server does not support RFC 5746, see CVE-2009-3555
    This appears on my error page everytime I try to use my credit card through paypal. I enter all of my info (billing, etc..) and after hitting the "review and confirm" button the same page reappears and has erased my cc number and leaving my name and billing info. What can I do to finish my transaction?

    The message about CVE-2009-3555 is meant for webmasters to make them aware that they need to fix their servers.<br />
    Firefox 3.6 versions can detect such a misconfiguration and displays a warning in the "Tools > Error Console".<br />
    * http://wiki.mozilla.org/Security:Renegotiation
    You may have a problem with the PayPal cookies.
    * "Remove the Cookies" from sites causing problems: Tools > Options > Privacy > Cookies: "Show Cookies"
    See also:
    * http://kb.mozillazine.org/Cookies#Removing_cookies
    * [[Cookies]]
    * [[Enabling and disabling cookies]]

  • Can I print before and after on the same page?

    Hi everyone.
    I'm really proud of my editing on a particular image.  I want to print the before and after on the same page, just like I can see the before and after side-by-side in the Develop mode.
    Is this possible?
    Thanks for your help.

    Yes but you will need to make a virtual copy by going to the menu:
    Photo >> Create Virtual Copy
    Then open copy 2 in the Develop module and from the history panel change the setting to the time of import (usually the bottom of the list) or use the re-set button to get back to the original file from camera.
    You can then select copy 1 & 2 and go to the Print module to set up your page with both images.

  • I use "element 12" and want  like in the old PS version due Automating and Contact  II upload multiple filesand print them with any columns and rows on the same page . How does it work?

    I use "element 12" and want  like in the old PS version due Automating and Contact  II upload multiple filesand print them with any columns and rows on the same page . How does it work?

    Can you supply a link?

Maybe you are looking for