Sage 100

 View Only
  • 1.  Need to write a VI job to export SO records. File

    Posted 08-26-2014 15:00
    Need to write a VI job to export SO records. File is simple no issues there. The tricky part is after the export is run I need to flag the sales order with a UDF as to which records were exported. Not sure if I should just write an import job and run that after the export or if there may be a better way to do this. Anyone have any ideas?


  • 2.  RE: Need to write a VI job to export SO records. File

    Posted 08-26-2014 15:14
    I would probably just import from the exported file and add the UDF.


  • 3.  RE: Need to write a VI job to export SO records. File

    Posted 08-26-2014 15:26
    Perform logic could be written to update a UDF after each line is written.


  • 4.  RE: Need to write a VI job to export SO records. File

    Posted 08-26-2014 16:00
    What they said. Or you could write a script that exports the records and updates the UDF.


  • 5.  RE: Need to write a VI job to export SO records. File

    Posted 08-26-2014 16:18
    Back in the day, I did this by exporting then immediately importing. Not sure if you can chain an import/export or not. Where are you adding the UDF? Header record? Interesting thought on the perform logic. @JimWoodhead , what would this look like? Are you using some PVX code?


  • 6.  RE: Need to write a VI job to export SO records. File

    Posted 08-26-2014 16:22
    It should be easy logic to open the Sales Order Header and Set value and write the record.... Yes PVX Preform logic


  • 7.  RE: Need to write a VI job to export SO records. File

    Posted 08-27-2014 01:28
      |   view attached
    If exporting out of SO_SalesOrderHeader one way is to click Perform and set it up like in the screenshot. The FlagSOHdr_UDF.pl text file could look like this: IF NOT(oSO) { oSO = NEW(""SO_SalesOrder_bus"", coSession) } retVal = oSO'SetKey(Var$) IF retVal = 1 { retVal = oSO'SetValue(""UDF_Exported$"", ""Y"") !Replace UDF name & value with yours retWrite = oSO'Write() } EXIT


  • 8.  RE: Need to write a VI job to export SO records. File

    Posted 08-28-2014 10:49
    So I tried all the fancy stuff and wasn't able to get it working so I decided on an export then import. And you can't chain them together so the client will just have to run two jobs. Oh well. Thanks everyone for your input!


  • 9.  RE: Need to write a VI job to export SO records. File

    Posted 08-28-2014 11:04
    You can definitely chain. you just need to manually type the name of the export. (it won't lookup but typing in works.)


  • 10.  RE: Need to write a VI job to export SO records. File

    Posted 08-28-2014 11:27
    I learn something new every day!


  • 11.  RE: Need to write a VI job to export SO records. File

    Posted 08-28-2014 11:27
    Cool! I got that to work! Thanks @JimWoodhead !