Importing sales orders Premium version

Have a request to schedule VI jobs automatically to run multiple times during the day but then they want the .csv file deleted out of the location since the next import file will be named the same. This is for importing sales orders. It's v2020.2 and Premium. Was thinking of using Task Scheduler in Sage to setup but it only has a choice of daily. I see there's a writeup on how to create a windows batch file to run a VI job outside of Sage and then use windows task schedule ForFiles Program Script to delete the files? I'm looking for advice on the most efficient way to accomplish.  Is another option to use BOI as well?

  • We use Perform Logic to rename the input file (adding date / time stamp) so it won't be overwritten when a new file is put in place, but you still have it for reference.

    ! Rename the source file (originally created by Slade Hornick)
    !
    ! Put the Import file in something more manageable
    f$=ImportFileName$
    !
    ! Close the source file, before trying to move it
    close (1,err=*next)
    !
    ! Create a name for the new file
    f_new$=f$+"-"+dte(0:"%Y%Mz%Dz-%Hz%mz%sz")+".imported"
    !f_new$=f_dir$+f_file$+".old"
    rename f$, f_new$
    exit
    
    

  • in reply to Kevin M

    Thank you. That would be a great option. Do you think creating a windows batch file to run a VI job outside of Sage is the most efficient way to run the same VI job multiple times a day? Or is windows task scheduler better?

  • in reply to dhalpin

    Create a batch file, then use Windows Task Scheduler to run it.  No mapped drives... and the Sage service account needs appropriate permissions.

    Since you are using Premium, be sure to add the changes to the Sage service, as described in the Sage KB.

    Running imports without this (in MAS90 mode) can cause problems.