June 6, 200520 yr Newbies I have setup an invoice file that has relationship to my product file. When I enter item # into the Item field (which is a portal) that item's price and description shows up in the invoice file's description and price field. I have to type each item # / copy paste it in. How do I make a script that will retrieve a list of item # from a text field separated by commas(or symbols) and insert each item into a field within the portal list thus making me an invoice? Thanks for any input!
June 13, 200520 yr are you creating new records for each item on the invoice? if so... put the item numbers into a table "tblImportInvoice". Create a value list on that table's item# field called "vlImportInvoices". Write the (bound to be buggy somewhere) script: ## Import Invoices # # Description: After loading invoice item numbers into the tblImportInvoice table, run this script to create your invoice # ## ## If [ IsEmpty ( Get ( ScriptParameter ) ] # First Pass through the script ... # get the found count and load it into ScriptParameter, so we can keep track # of how many invoice items we've added Go to Layout [ myInvoice ] Go to Field [ tblInvoice::Primary_key_field ] # ...tblInvoice is the proper table in the invoice file Enter Find Mode [] Insert From Last Visited [ Select ; tblInvoice::Primary_key_field ] Perform Find [] Perform Script [ thisScript ; GetAsText ( Get ( FoundCount ) ) ] Else # Second Pass, Loop the value list and add invoices Loop # foundcount - scriptparameter = place in value list index / number of added items Set Field [ <item # field> ; Substitute ( MiddleValues ( ValueListItems ( Get ( FileName ) ; "vlImportInvoices" ) ; ( Get ( FoundCount ) - Get ( ScriptParameter ) + 1 ) ; 1 ) ;
June 14, 200520 yr the set field loop should have a Commit after it and a New Record before it. there's also some typos but otherwise I think that's it.
Create an account or sign in to comment