AnsweredAssumed Answered

How do i make a script that makes Multiple Variables from One Field in Multiple Records

Question asked by WilliamSouth on Nov 17, 2013
Latest reply on Nov 21, 2013 by philmodjunk

Title

How do i make a script that makes Multiple Variables from One Field in Multiple Records

Post

     I'm making an invoice database  that incorporates a Purchase Order System for special orders.

     So in my Line Item Data Table I have a serial number field(:pf_order_No ) for each line item. Which is related to my Purchase Order Table

     Some line items will be special order, Lay Away or Taken. The only records that i will need to be made will be the "To Be Ordered"

     So multiple records will be  made in my Purchase Order Table which will be determined through each invoice and the line items in it.    

     My question is how do i make a script that makes Multiple Variables from One Field in Multiple Records.

     Below is a simple script that works for only the first Line item. I could duplicate the script for each record changing $INVOICEx

But that becomes inefficient, and on my purchase order side duplicate records.

Go to Record/Request/Page [ First ]
Set Variable [ $$INVOICE_ID; Value:Invoices::Invoice ID ]

If [ Invoice Data::TBO LWY TKN="To Be Ordered" ]

Set Variable [ $INVOICE1; Value:Invoice Data::pf_order_No ]

Go to Record/Request/Page[ Next ]

Else
                    Go to Record/Request/Page
[ Next ]

End If

Go to Layout [ “Print Bridesmaid PO” (Purchase Orders PO) ]

If [ $INVOICE1 "" ]

New Record/Request
                    Set Field
[ Purchase Orders PO::kf_order_No; $INVOICE1 ]

Commit Records/Requests

End If

                    Hope I explained it right, thanks in advance

      

Outcomes