Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7105 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

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!

Posted

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 ) ;

This topic is 7105 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.