Sage 100

 View Only
Expand all | Collapse all

Has anyone automated VI importing to multiple comp

Brett Zimmerman

Brett Zimmerman04-15-2011 13:15

Jim Woodhead

Jim Woodhead04-15-2011 13:21

Brett Zimmerman

Brett Zimmerman04-15-2011 13:22

Brett Zimmerman

Brett Zimmerman04-15-2011 13:24

Brett Zimmerman

Brett Zimmerman04-15-2011 13:24

Jim Woodhead

Jim Woodhead04-15-2011 13:28

  • 1.  Has anyone automated VI importing to multiple comp

    Posted 04-14-2011 10:29
    Has anyone automated VI importing to multiple companies?


  • 2.  RE: Has anyone automated VI importing to multiple comp

    Posted 04-14-2011 10:46
    What are they trying to do? This can be done with scripting.


  • 3.  RE: Has anyone automated VI importing to multiple comp

    Posted 04-14-2011 10:48
    To clarify: want to auto launch a VI job for 1 company and then have that same job run for a 2nd company, and a 3rd, and so on. (4.30)


  • 4.  RE: Has anyone automated VI importing to multiple comp

    Posted 04-14-2011 11:11
    Since you can launch a VI job via a shortcut, you can do this from a VB Script. Just call a sh.Run ""..."" command with the full path etc. of the command line. The other option is to create a batch file that contains the references for all the companies.


  • 5.  RE: Has anyone automated VI importing to multiple comp

    Posted 04-14-2011 11:24
    I thought about just creating a .bat file containing multiple company-specific lines of the VI shortcut but I thought that may present a conflict with the next shortcut running before the previous one completes.


  • 6.  RE: Has anyone automated VI importing to multiple comp

    Posted 04-14-2011 11:31
    You can put a wait in the batch file between each command like. let me know if you need the syntax.


  • 7.  RE: Has anyone automated VI importing to multiple comp

    Posted 04-14-2011 14:26
    I tried this several years ago and it was a disaster. The wait times were never long enough, as it seemed like something was always causing yet another problem. I also recall getting errors because the log file would not be closed before the next job began. This was on 3.71. so it may be worth trying now. Ultimately, it was cheaper to implement one job with multi-company GL than continue tweaking the batch file.


  • 8.  RE: Has anyone automated VI importing to multiple comp

    Posted 04-14-2011 14:40
    I do it all the time. I use a ping command which stops the batch file and then continues whenthe time is finished. This works well for automated batches. If you need user intervention, then use a pause command. It prompts the user to hit enter to continue.after each step. I like Mark's idea too...... DSD has a great multi-company add on for AP and GL :)


  • 9.  RE: Has anyone automated VI importing to multiple comp

    Posted 04-15-2011 13:09
    Ok, this is killing me. Normally I love a good challenge but it's Friday, it's nice out, and I'm ready for weekend-mode. Trying to run a VI import on 4.40 from a .bat file or Windows Shortcut, and I keep getting this Error #12: Unable to initialize lead program - Error #12: File does not exist (or already exists). Here's my string: ""C:\Sage Software\Version440\MAS90\Home\PVXWIN32.EXE"" ..\LAUNCHER\SOTAPGM.INI ..\SOA\STARTUP.M4P DIRECT UION vi vi WA1 VIWI00 AUTO The job runs fine when I run it manually inside MAS 90 VI. I've addressed the usual suspects but still am unable to get past this error. - MAS 90 path is correct - Job is on the VI Jobs menu - vi User Logon has Full Access in Role Maint - tried ""running as Administrator"" - re-ran workstation setup and tried again


  • 10.  RE: Has anyone automated VI importing to multiple comp

    Posted 04-15-2011 13:12
    in the batch file do this. 1st line c: 2nd line cd ""\sage sofware\version440\mas90\home"" 3rd line pvxwin32.exe .......


  • 11.  RE: Has anyone automated VI importing to multiple comp

    Posted 04-15-2011 13:15
    Thx. Still getting Error 12 though.


  • 12.  RE: Has anyone automated VI importing to multiple comp

    Posted 04-15-2011 13:20
    Are you doing this on a workstation or on the server.


  • 13.  RE: Has anyone automated VI importing to multiple comp

    Posted 04-15-2011 13:21
    Attach your batch file and I'll look at it


  • 14.  RE: Has anyone automated VI importing to multiple comp

    Posted 04-15-2011 13:22
    workstation


  • 15.  RE: Has anyone automated VI importing to multiple comp

    Posted 04-15-2011 13:24
    Wait, just realized I'm missing -ARG


  • 16.  RE: Has anyone automated VI importing to multiple comp

    Posted 04-15-2011 13:24
    in the batch file you should be piont to the network location. from the workstation . Although I think there is a write up about that recently too.


  • 17.  RE: Has anyone automated VI importing to multiple comp

    Posted 04-15-2011 13:24
      |   view attached
    attached

    Attachment(s)

    zip
    vi.zip   285 B 1 version


  • 18.  RE: Has anyone automated VI importing to multiple comp

    Posted 04-15-2011 13:27
    Here is a fancy one I wrote. :) #VI #BATCH Rem This assumes the the VI is set you import the d:\Output\Output.csv file Rem it waits 60 seconds then move the file to a holding folder with a timestamp of the import. REM you can add a move command if necessary to setup the output.csv file REM SET LABEL REM new file copy with date and time yymmdd_hhmmss REM where yymmdd_hhmmss is a date_time stamp like 030902_134200 set hh=%time:~0,2% REM Since there is no leading zero for times before 10 am, have to put in REM a zero when this is run before 10 am. if ""%time:~0,1%""=="" "" set hh=0%hh:~1,1% set yymmdd_hhmmss=%date:~12,2%%date:~4,2%%date:~7,2%_%hh%%time:~3,2%%time:~6,2% set FileName=output-%yymmdd_hhmmss% REM YOu need to then change on to the mas90\home folder d: cd \sage\erpserver\mas90\home PVXWIN32.EXE ..\LAUNCHER\SOTAPGM.INI ..\SOA\STARTUP.M4P -ARG DIRECT UION SQL SQL GSC VIWI1J AUTO rem ""Wait for Order to finish importing"" @ping 127.0.0.1 -n 60 > nul Rem ""Done with import"" move d:\Output\Output.csv d:\sage\imported\%filename%.csv REM this bat command can be added to the window schedule to run as often necessary


  • 19.  RE: Has anyone automated VI importing to multiple comp

    Posted 04-15-2011 13:28
    It has some great move logic too.


  • 20.  RE: Has anyone automated VI importing to multiple comp

    Posted 04-15-2011 13:29
    This is run on the server not the workstation and can be added as a windows scheduled job.


  • 21.  RE: Has anyone automated VI importing to multiple comp

    Posted 04-15-2011 13:34
    Arrrgh, somebody please come and slap me across my face. Been troubleshooting this frigin thing for well over an hour, and no matter how many times I looked at the string, I just ""now"" realized the -ARG was missing. Although even after correcting it, I still get the Error 12. But doing as @JimWoodhead suggested with breaking the string into 3 lines, took care of it.


  • 22.  RE: Has anyone automated VI importing to multiple comp

    Posted 04-15-2011 13:36
    After the 1st hour I did say to myself that I needed to step away from this for a bit and come back to it. But did I? No!


  • 23.  RE: Has anyone automated VI importing to multiple comp

    Posted 04-15-2011 13:39
    You got it fixed just in time for the weekend!! Yeah! I unfortunately have about about 5 hours of reports and VI to convert (3.71 to 4.4).. :( no early weekend for me.


  • 24.  RE: Has anyone automated VI importing to multiple comp

    Posted 04-15-2011 13:40
    @JimWoodhead, I actually did pull down your .bat from a previous SC post but didn't think of breaking into 3 sep lines. I also see the line that says: @ping 127.0.0.1 -n 60 > nul Is that telling the .bat to wait 60 seconds before proceeding (to the next line)? Is that IP generic or specific to the system you were working on?


  • 25.  RE: Has anyone automated VI importing to multiple comp

    Posted 04-15-2011 13:44
    the 127.0.0.1 is the local ip to the machine so it will work anywhere on any machine. BTW, -n 60 is the number of pings and roughly relates to seconds. so 60 is a 1 minute and 120 is 2 minutes. If you run the batch manually you can test the ping timing. It is pretty cool.


  • 26.  RE: Has anyone automated VI importing to multiple comp

    Posted 04-15-2011 13:45
    I tested it out already. Slick. Works like a charm. Thanks!!!


  • 27.  RE: Has anyone automated VI importing to multiple comp

    Posted 04-15-2011 13:48
    It is something I found on a couple years ago somewhere on the internet. it is definitely handy for batch files.


  • 28.  RE: Has anyone automated VI importing to multiple comp

    Posted 04-15-2011 13:55
    I also just tried it without a wait/pause in between each company-specific VI shortcut line/string, and it appears to have imported successfully to all 3 companies. Originally I was thinking it may present a conflict with the next shortcut running before the previous one completes, but it seems to be okay. Or is that just a bad idea to risk it, and instead it's best to just put a wait between each? Of course this particular import test was only importing 4 lines into G/L Journal Entry so it's a quick import. I think I'll try a test with lots more data - although it's probably not gonna hurt to just have a wait between each.