Sage 100

 View Only
  • 1.  VI Import Package Numbers

    Posted 01-24-2020 15:38
    I have a client that processes packages via WorldShip out of order, where boxes associated to an order are processed separately. Because of this, the WorldShip CSV export treats each package as number '0' and not a sequential count that would normally happen if all packages were processed together. This leaves me with a challenge in VI as the tracking numbers are written to the SO_InvoiceTracking table. I can't use the package number from WorldShip since it will overwrite the previous package as each tracking number is written.

    VI does not allow any 'Next" functionality on PackageNo and so far I'm unsuccessful in using the VI job create a sequential package number when importing. PackageNo is a required field for imports. The first import should create a package 0001 and then any subsequent imports should increment.

    Has anyone been successful in getting something like this to work?

    #Sage100 #TrackingNo #VI


    ​​​​​​

    ------------------------------
    Bill Pfahnl
    Nims & Associates
    ------------------------------


  • 2.  RE: VI Import Package Numbers

    Posted 01-27-2020 02:31

    You could use a calculated Temp field and increment it on each record but this would be making several assumptions. Does your source file only contain the tracking numbers and package numbers for an invoice or is it also used to contain item information that would need to go into SO_InvoiceDetail?
    If the former, i think the temp field would be enough but it would be assuming that every line is a different tracking number although i suppose you could use some conditional checks to determine when to reset the package number to 0 and when to increment it.
    You can either use a single string temp field or a numeric temp field and a string temp field. If you use a single string temp field, the calculation would look something like this on the temp field Temp001$.

    STR(NUM(Temp001$)+1:"0000"))

    If your source contains lines for multiple invoices, you will definitely need to work in logic to reset it to 0.
    This also assumes you are only ever going to import lines for any given invoice once, if you import 3 lines one time for an invoice and then they import 2 more lines, each containing a tracking number not imported previously, then these two lines will overwrite the first two lines imported previously.
    The surest way to avoid conflicts would be to use either perform logic or a script to use the tracking number as an alternate "key" using GetResultSets since SO_InvoiceTracking only has a primary index consisting of the invoice number and the package number, i'm surprised there isn't an alternate one including the tracking number. This would check each tracking number in the source against existing records for the current invoice and if the tracking number exists, then, update that record, if not, then find the next available package number for the current invoice.



    ------------------------------
    David Speck II
    Tennessee Software Solutions
    ------------------------------



  • 3.  RE: VI Import Package Numbers

    Posted 01-28-2020 01:47
    You could pre-process the CSV file with a VBScript that would add a sequential package number field. Whenever the data that triggers the next invoice number to change, the package number could be reset to zero.

    ------------------------------
    Dan Burleson
    Software Consultant
    Connex Software
    Corvallis OR
    541-224-6642
    ------------------------------



  • 4.  RE: VI Import Package Numbers

    Posted 01-28-2020 15:08
    Thanks all. For now, we decided to use the last 4 digits of the tracking number as the package number. It's looks a bit odd but it works. We'll consider the other great options if it's a problem going forward. Thanks again.

    ------------------------------
    Bill Pfahnl
    Nims & Associates
    ------------------------------