Sage 100

 View Only
  • 1.  OrderLineKey

    Posted 12-20-2023 15:47

    Has anyone created some scripting to get the OrderLineKey from a PO for a ROG Import, assuming that any particular part is only on the PO once?



    ------------------------------
    Beth Bowers
    (269) 358-0989
    ------------------------------


  • 2.  RE: OrderLineKey

    Posted 12-20-2023 16:03

    I don't think I've done that one exactly, but I have done similar scripts... running a text/csv file through a VBScript to produce a new file with the added column.

    • VBScript prompts for input file.
    • Read the file, create an array of lines and loop.
    • For each line:
      • Split into a column array, to get your values for the lookup (PO#, Item...).
      • ODBC query using the lookup values.
      • MoveFirst in your return set, and grab the needed value.
      • Add a line to your output file with the new value inserted... or an error, if not found.
    • Use the new file for VI.


    ------------------------------
    Kevin Moyes
    Technical Systems Analyst
    Munjal White Consulting Co.
    Toronto ON
    ------------------------------



  • 3.  RE: OrderLineKey

    Posted 12-20-2023 16:09

    I can actually see the back of my skull at this point, @Kevin Moyes.  YOWZA.  Or UGH.  Or maybe just those little # you see for eyes in cartoons when someone has been hit over the head (or has gotten drunk).



    ------------------------------
    Beth Bowers
    (269) 358-0989
    ------------------------------



  • 4.  RE: OrderLineKey

    Posted 12-20-2023 16:30

    LOL!

    >.<

    For anyone who hasn't done scripted text file manipulation / loops / arrays / ODBC queries... that probably isn't the easiest kind of script to take on.



    ------------------------------
    Kevin Moyes
    Technical Systems Analyst
    Munjal White Consulting Co.
    Toronto ON
    ------------------------------



  • 5.  RE: OrderLineKey

    Posted 12-21-2023 23:09
    Edited by Dan Burleson 12-21-2023 23:17

    Power Queries can get complex, but connecting a CSV file to a Sage 100 PO_PurchaseOrderDetail by a common field is only a Merge Query and Expand Table steps. Then the resulting ".xlsx" file can be saved as CSV or kept as is and be imported directly by VI. No macros. No coding. Just replace the CSV file, Refresh the query, save, and import.

    The Excel Power Query Editor Conects Tables of Diverse Origins by a Common Field



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