Master-Detail

medimacs

New Member
Hi,

Perhaps RTFM will be the answer to this question, but I just did that, and can't find an answer or example of a simple master detail application.

e.g. I like to make a simple Invoice program with following tables:
invoice (id, ClientInfo,....)
invoice_lines(id,invoice_id,description,amount...)

Where invoice_id is pointing to the invoice tabel.

How do I start implementing this?

After filling in the invoice-date, I'd like to have a kind of table-view where rows can be added and where the invoice_id is automatically linked to the invoice tabel.

Best regards,

Peter
 
Hi

Try creating a table join (not an element join type) from your invoice table to your invoice_lines table:

under the table's data tab, press the "add table join" button
select "left join"
Table to join from: invoice
Table to join to: invoice_lines
This tables join column: id
Join tables join column:invoice_id

This will create a new group containing all the invoice items, and make the table show data in this format:

id, clientinfo, id, invoice_id, description
1 'client 1' 1 1 'item 1 - invoice 1'
1 'client 1' 2 1 'item 2 - invoice 1'
2 'client 2' 3 2 'item 1 - invoice 2'
2 'client 2' 4 2 'item 2 - invoice 2'
2 'client 2' 5 2 'item 3 - invoice 2'

From here we need to group the data on the invoice_id, so we select the table's data tab and select "invoice_id" from the "group by" drop down.

The table then needs to use the "standard-groupby" template which will display the data in this format:

Invoice 1
invoice item 1
invoice item 2
Invoice 2
invoice item 1
invoice item 2
invoice item 3

I *think* that if you edit the invoice items group so that its "add repeat group" option is turned on, this will allow you to add invoice items to the invoice

Hope that helps
Rob
 
Rob Clayburn said:
The table then needs to use the "standard-groupby" template which will display the data in this format:

Invoice 1
invoice item 1
invoice item 2
Invoice 2
invoice item 1
invoice item 2
invoice item 3

I *think* that if you edit the invoice items group so that its "add repeat group" option is turned on, this will allow you to add invoice items to the invoice

Rob-
I've read all the form posts about how to make a custom "standard-groupby" template but none speak to how to have it look the way you've stated above. How do I have the joined elements appear all together in one row. I see a reference to the {CHILD} in the patTemplate file but am lost in how to do this....

Could you please post an example group-by template using the invoice example above thanks?
-barnett
 
haven't heard anything in a while.... any ideas how to make a patTemplate for this specific example.

thanks
-Barnett
 
Hi Rob
I have followed the steps outlined above, and all wasfine until I activated the GroupBy settings.
I have done EXACTLY as detailed above, but when the table loads i only get three columns as follows
| URL | Owner | Active |

HUH?
 
I'm searching this forum for the same and I can't seem to find anything. This is pretty common feature and there should be an example how to do it.
 
I'm looking for the same, and after looking at the previous posts and examples still can't get ti to work the way I want. This is reall standart feature and we really wan an example, PLS.

Arthur
 
T\there is one other thing I need to figure out. Here is an example:

HEADER_TABLE
INVOICE_ID=1

DETAIL_TABLE
INOICE_LINE=1 (then in each next record it is autonumbered to 2,3,4,....)
INVOICE_ID= ????


the question is how to awssign INVOICE_ID from the parent (HEADER_TABLE). Is this handled automaticaly, or I need to set something up ? I have relationship setup like this:
FromTable: HEADER_TABLE
ToTbale: DETAIL_TABLE
FromColumn: InternalID
ToColumn: INVOICE_ID

when I open INVOICE_DETAIL for editing INVOICE_ID is empty
I thought I could use 'Default' property for the INVOICE_ID column to prime it with INVOICE_ID from the parent record, but not sure what the syntax is

Arthur
 
are you really using fabrik 1? or have you posted in the wrong forum.
can you point me at the page where you have tried to set this up - its a pretty standard (if fiddly) thing that we do regularly in fabrik so if you followed the instructions correctly it should work
 
is it possible to have the detail form in rows? then clicking on the detail rows will load the detail form to allow me to edit or add new record to the details. thanks.
 
is it possible to have the detail form in rows? then clicking on the detail rows will load the detail form to allow me to edit or add new record to the details. thanks.

lemme elaborate a bit:

my detail form is using controls (textbox,radio,dropdown..) rather than displaying rows for each detail record. is there a way to have the detail group display rows rather than form controls?

form controls are for edit/add forms.

thanks.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top