It's hard to tell from this post exactly what you want to do.
If your order lines in the portal read:
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.
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.
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]
Set Variable [$OrderLineID ; Value: OrderLines::OrderLineID]
Set Variable [$Qty ; Value: OrderLines::Quantities]
Go To Layout [Labels ( Labels)]
Exit Loop If [$Qty < 0 ]
Set Field [Labels::OrderLineID ; $OrderLineID]
Set Variable [$Qty ; Value: $Qty - 1]
Go To Layout [OrderLines]
Go To Record [Next ; Exit after Last]
Go To Layout [Labels]
Enter Find Mode
Set Field [ OrderLines::OrderID ; $OrderID]
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