8 Replies Latest reply on Mar 21, 2017 2:49 PM by philmodjunk

    Multiple entries of the same line item.

    kaotishe

      I have a table for products with a portal to a child table with line items that make up the products in the parent table. This part is well and good however I am running into two issues and I don't seem to be able to find the answer in discussions here or in videos on youtube.

       

      1) When I go to enter the same line item for a second product it creates a whole new entry in the line item table instead of referring back to the existing entry for that line item.

       

      2) And I believe when the above gets corrected this will cease but there is not price information for the new line item. I suspect theses because the new entry has no pricing information, but  is there a specific setting I need for it to pull the additional fields from a table entry when it is matched?

        • 1. Re: Multiple entries of the same line item.
          Johan Hedman

          1) Sounds like you have setup your relationship wrong

           

          It should look like this if you want to create a record through the relationship

           

          Skärmavbild 2017-03-21 kl. 08.30.53.png

          • 2. Re: Multiple entries of the same line item.
            Magnus Fransson

            Hi kaotishe,

             

            I believe that you have missed to properly resolve a "Many to Many" relationship between the "Products" and "Line items". To do that you have to create a third table, a so called "Join table". The result should look something like this:

            Products--------<Products_to_line_items_Join>--------Line_items

             

            With best regards Magnus Fransson.

            • 3. Re: Multiple entries of the same line item.
              kaotishe

              Magnus, Yes I was missing a join table. Having worked with it today it appears that everything now works as it should. However the videos I referenced on join tables all show the join table as having multiple entries in it. Mine has none. Is that an issue? It does not appear to be.

               

              Also as a matter of interface, I would like to put a button on the products table that opens a popup (i guess) that has the line item table in it. This way new line items can be added without leaving the Product table and both the line item and line item product join tables can be hidden from normal use. To do that would i just be putting a portal in a popup?

              • 4. Re: Multiple entries of the same line item.
                philmodjunk

                If the join table is working, it has multiple entries in it.

                • 5. Re: Multiple entries of the same line item.
                  kaotishe

                  Then why don't they display in the join table table view? It show no entries at all.

                  • 6. Re: Multiple entries of the same line item.
                    philmodjunk

                    Did you show all records on that layout?

                     

                    Does table view specify any fields for the view?

                     

                    If there truly are no records in the table, it isn't being used as intended.

                    • 7. Re: Multiple entries of the same line item.
                      kaotishe

                      I found the problem, somehow the layout was not associated with  the table. not sure how that occurred as FileMaker created that layout, but it is fixed now and shows 19 records.

                       

                      So how about this "I would like to put a button on the products table that opens a popup (i guess) that has the line item table in it. This way new line items can be added without leaving the Product table and both the line item and line item product join tables can be hidden from normal use. To do that would i just be putting a portal in a popup?"

                      • 8. Re: Multiple entries of the same line item.
                        philmodjunk

                        both the line item and line item product join tables can be hidden from normal use.

                         

                        That makes no sense. The Line Item IS your join table. I don't see why you'd have two such tables here. I can see where someone else suggested that set up, but it's not clear to me why you need that combination of tables and relationships.

                         

                        Parent-----<LineItems>----Products

                         

                        I think people misunderstood what you meant by 1) in your original post. I can't tell from what is written there exactly how you do this:

                        I go to enter the same line item for a second product

                        I think that you mean that you've added a line item for Product A and now you want to add a second "Product A" to your line items without adding a second record but by incrementing a Qty field instead.

                         

                        But exactly what steps do you take to add that "line item for a second product" and am I correctly understanding you?