6 Replies Latest reply on Feb 21, 2012 10:36 AM by willrollo

    displaying linked invoices to a customer

      Title

      displaying linked invoices to a customer

      Post

      Hi

      I have a layout called 'History'. It shows records from 'Customers' Table. What I want is for this layout to display a list of all the orders linked to the customer record being viewed. I also want the first line of the invoice to appear (Lines::Description). 

      So the Line would have 5 fields next to each other. - order number, Date, description, invoice total.

       

      Can this be done in browse mode (List View) or just fins mode? Portal? I have got as far as showing a list of all the orders, I cannot get FM to just display records linked the customer record being viewed...

      Can anyone help?

      I feel I amy not to make this a little clearer so do ask what info required in order to help..

      I assume I need to enter find mode and omitt all records other than the one being viewed. - GTRR? Not sure how to tell FM to use the customer record and not show all the line items for each invoice instead of just the first Line...

        • 1. Re: displaying linked invoices to a customer
          philmodjunk

          If you have this relationship in manage | database | relationships (but perhaps with different names):

          Customers----<Invoices----<Lines

          Customers::CustomerID = Invoices::CustomerID
          Invoices::InvoiceID = Lines::InvoiceID

          Then you can use a portal to Invoices on your History layout to display all invoice records for that customer. You can add the Lines::Description field from the Lines table to this portal row and it will show the first related line record.

          • 2. Re: displaying linked invoices to a customer

            Hi Phil

            Thank you - got it working now on the whole. Two glitches though..

            1/ One of my fields on the poral is for Net Value. It appears on the first line of the poral but not any anything below.

            2/ I have a go to related record on each line so I can view the original order/quote/invoice (diff layouts depending on what type of order). But the script I have written takes me to the first line on the portal's order..

            Thank you

            • 3. Re: displaying linked invoices to a customer
              philmodjunk

              1) you'll need to tell me more about that field. How is it defined? in what table?

              2) I'd need to see your script. Typically, this is the result if some script step that precedes the go to related records step moves the "focus" out of the clicked portal row. In one recent case, a poster was opening a new window before the GTRR step.

              To post a script to the forum:

              1. You can upload a screen shot of your script by using the Upload an Image controls located just below Post A Answer.
              2. You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF to your clipboard for pasting here.
              3. If You have FileMaker advanced, you can generate a database design report and copy the script as text from there.
              4. If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional and easier to read format. (Use the HTML option on the database tab panel and paste the text into the forum's HTML editor.)
              • 4. Re: displaying linked invoices to a customer

                Hi Phil

                Attached is my script..

                The 'History' layout is using records from the customers table. It contains fields in the portal (invoice details) from Lines and Invoice details. The "Nett price" field I am having trouble with is from Invoice details table. But there are a few other fields on the portal also from Invoice details, and these show fine on the other rows. 

                Anyything else you need?

                Thanks

                • 5. Re: displaying linked invoices to a customer
                  philmodjunk

                  Yep, your script has the same problem that I saw in another poster's script. The New window command changes the focus and thus your GTRR step goes to the first related record.

                  Remove the new window steps. You don't need them. If you want this to open in a new window, select the new window option from within the GTRR steps.

                  How is the net price field defined?

                  How did you add it to your portal row? (any chance that it's a pixel too far to the side and thus isn't really "in" the portal?)

                  • 6. Re: displaying linked invoices to a customer

                    Perfect - all issues sorted...If only all of my FM problems were as simple to resolve!

                    Thank you!