3 Replies Latest reply on Nov 5, 2010 1:12 PM by philmodjunk

    Print more than 1label per line in lineorder

    LeopoldoBenavidesBerrocal

      Summary

      Print more than 1label per line in lineorder

      Product

      FileMaker Pro

      Version

      11

      Operating system version

      macosx

      Description of the issue

      I have Customer, articles, orders and ordersline.

      Right now in orders I put per line only 1und in the field quantity, because i can´t do the script to print the label for more than 1 und per quantity, so i have to repeat the same times than quantities in order.

      Example: (I´ll like to do this way)

      ref.1.  Description 1. price 10€. quantities10und.  (and clic print to print 10 und at once, but i can´t do the script)

      But right now this is the way i´m doing.

      ref1. description1. price 10€ quantities1und
      ref1. description1. price 10€ quantities1und
      ref1. description1. price 10€ quantities1und
      ref1. description1. price 10€ quantities1und
      ref1. description1. price 10€ quantities1und
      ref1. description1. price 10€ quantities1und
      ref1. description1. price 10€ quantities1und
      ref1. description1. price 10€ quantities1und
      ref1. description1. price 10€ quantities1und
      ref1. description1. price 10€ quantities1und

      so as you see the ten lines add 10 quantities and i can print the labels for each article, but the problem is when i have more than 100 und., how can i do the script?

      thanks

        • 1. Re: Print more than 1label per line in lineorder
          philmodjunk

          It's hard to tell from this post exactly what you want to do.

          If your order lines in the portal read:

          Widgets 10
          Things    5
          Gadgets  6

          Do you need to print 21 labels, one for each ordered item in OrderLines?

          If so, you might want to create a special labels table that a script populates with data from order lines so that you can print all your labels in one print job.

          • 2. Re: Print more than 1label per line in lineorder
            LeopoldoBenavidesBerrocal

            Yes it´s that. (I need to print 21 labels....)

            so, I need another table (labeltable) and create a script, it´s that.

            can you tell me how can I start the script, I don´t know how to say: copy the item as many time as quantity.

            Thanks.

            • 3. Re: Print more than 1label per line in lineorder
              philmodjunk

              This isn't the simplest thing in the world to set up in filemaker.

              You can define an auto-entered serial number in OrderLines so that each record in the table has a unique identifier.

              Define your Labels table with just one field, a number field you can use to link records in this table to your OrderLines table.

              OrderLines::OrderLineID = Labels::OrderLineID

              On your new Labels layout, you can set up the layout to print labels in the format you need. You can add fields from OrderLines and any tables related to OrderLines as needed to get the label you want.

              Now write this script and run it from your orders layout:

              If [ Not isEmpty ( OrderLines::OrderID ) ] //use the field that links OrderLines to Orders
                 Set Variable [$OrderID ; Value: OrderLines::OrderID]
                 Go To Related Records [ show only related records ; from table: OrderLines ; using layout: "orderlines" (orderlines) ]
                 Go to Record [first]
                 Loop
                     Set Variable [$OrderLineID ; Value: OrderLines::OrderLineID]
                     Set Variable [$Qty ; Value: OrderLines::Quantities]
                     Go To Layout [Labels ( Labels)]
                     Loop
                         Exit Loop If [$Qty <  0 ]
                         New Record/Request
                         Set Field [Labels::OrderLineID ; $OrderLineID]
                         Set Variable [$Qty ; Value: $Qty - 1]
                     End Loop
                     Go To Layout [OrderLines]
                     Go To Record [Next ; Exit after Last]
                   End Loop
                   Go To Layout [Labels]
                   Enter Find Mode[]
                   Set Field [ OrderLines::OrderID ; $OrderID]
                   Perform Find[]
                   Print[Restore]//or you can enter preview mode and pause, letting the user print from the File Menu before continuing
                   Delete All Records [No Dialog] //this is a scratch table, so you don't want to keep the records around
                   Go To Layout [original layout]//return to Orders layout
              End IF