4 Replies Latest reply: Nov 17, 2013 11:23 AM by B.Delmée RSS

    how to turn a table-based form into a master/detail ?

    B.Delmée

      Hello, I have a form based on a table on which I have spent quite a bit of time adjusting presentation and adding dynamic actions.

      Now comes the requirement to handle an open number of related records, ideally on the same page.

      Has someone documented the steps needed to turn a record-based form into a master/detail one ?

      I am using APEX 4..2.1

        • 1. Re: how to turn a table-based form into a master/detail ?
          Nicolette

          B. Delmée

           

          Assuming you mean you want to add a tabular form that displays the child records of the form you already have.

           

          Use the wizard to add the tabular form.

          Make sure you select the parent foreign key as updatable column.

           

          Change the parent FK column to hidden. And sets it's default to the page item that has the primary key of the parent.

          Add the where clause to the source of the tabular form. So only the childs of the current parent are shown.

          Add the condition to the tabular form region. So the region doesn't show when the page item that has the primary key of the parent is null.

           

          If you think your are missing something you could create the master detail pages for comparison. And delete these dummy pages when your done.

           

          Nicolette

          • 2. Re: how to turn a table-based form into a master/detail ?
            B.Delmée

            Thanks a lot Nicolette, this sounds promising (haven't tried just yet and won't have time before a couple days,will report back).

            When you say "Use the wizard to add the tabular form.", do you mean the regular form or master/detail wizard ?

            I did not know one could ask it to inject its sections/processes into an exiting page...

            • 3. Re: how to turn a table-based form into a master/detail ?
              Nicolette

              B.Delmée

               

              B.Delmée wrote:

               

              Thanks a lot Nicolette, this sounds promising (haven't tried just yet and won't have time before a couple days,will report back).

              When you say "Use the wizard to add the tabular form.", do you mean the regular form or master/detail wizard ?

              I did not know one could ask it to inject its sections/processes into an exiting page...

              No I mean the wizard for a tabular form. Start with create a region. Then choose "Form" and than "Tabular form". And follow the rest of the wizard.

              Remember that you are only creating the detail part. So choose the child table as table.

               

              Nicolette

              • 4. Re: how to turn a table-based form into a master/detail ?
                B.Delmée

                If you think your are missing something you could create the master detail pages for comparison. And delete these dummy pages when your done.

                 

                 

                I finally got around to working on this. You got me on the right track Nicolette, so thank you for that.

                I also had to fix bits in making processes conditional, and branching, too.

                Mainly this has to do with the "delete checked" button which deletes detail records, and submits the page to itself.

                One also needs to rename the REQUEST used in that case from MUTLI_ROW_DELETE to APPLY_CHANGES_MRD

                (as this pattern will trigger an UPDATE for the master record)

                All in all doable but one needs to be careful and generating a quick example M/D page for reference is useful.

                In my case I reckon this was still faster than re-doing all the layout adjustments and DA's

                (plus I got to better understand how this all works - there are a couple moving parts, all interdependent)