3 Replies Latest reply on Nov 2, 2011 12:33 PM by philmodjunk

    Return a subset of records with a subtotal

    MichaelMazza

      Title

      Return a subset of records with a subtotal

      Post

      I'm trying to figure out the best way to create a receipt which contains line items stored in a table.  Simple database used for auction.  Attendee, AuctionItems and WinningBids.  Attendees and Auction items are static table.  WinningBids and Attendees are related by paddle# field.  Winning bids is where we are entering the auctin item, Paddle#  and $ amount.  I need a way to create a receipt so that I can select an individual attendee and report all of the line items in WinningBids that they purchased. My initial thougt was to create a script and attach to a button but I'm not versed in apple script.  Any suggestions or examples someone can point me to?  thanks Mike

        • 1. Re: Return a subset of records with a subtotal
          philmodjunk

          You wouldn't use Apple Script for this, you'd create a script in Manage | Scripts and this scripting system is less complex than Applescript.

          Check out how invoices are printed in this very simple demo file: http://fmforums.com/forum/showpost.php?post/309136/

          Does that look similar to what you want?

          If so, open Manage | Database | Relationships and compare its design to what you have.

          Then select Manage Scripts from the Script menu and open up the script used to see how it works.

          • 2. Re: Return a subset of records with a subtotal
            MichaelMazza

            I think I am following it.  My plan was was different.  My line item table will hold the auction items that each attendee buys throughout the night.  I want to be able to click in a field and all teh attendees come up then select generate invoice and all the items in the line item table related to teh attendee selected will display in an invoice format.

            • 3. Re: Return a subset of records with a subtotal
              philmodjunk

              Sounds like a fairly straight forward adaptation of how this demo file prints an invoice.

              I'd start an invoice record for each attendee when they first place the winning bid on their first purchase, then add additional line item records in the invoice portal as they purchase additional items. That keeps every item purchased associated with an invoice record and through it to a specific customer record.

              If you have this relationship:

              Customers----<invoices----<lineItems

              Then it's pretty easy to start with a list of customers on your screen, and be click a Customer Name to see the invoice for that customer with their current auction purchases listed on it.

              That keeps it fairly simple for you to set up.

              Alternatively, it is also possible to enter a paddle number in a field in each line item record and use that to pull together all of a customer's purchases. This would be much the same as how the invoiceID is used in the demo file, but you'd need to take additional steps to limit the records pulled up to just those from tonight's auction so that you don't pull up items purchased with that paddle number in a previous auction.