Sage 100

 View Only
Expand all | Collapse all

Does anyone have an example of the command line us

  • 1.  Does anyone have an example of the command line us

    Posted 03-08-2012 05:51
    Does anyone have an example of the command line used to execute a batch file (or another program) from VI perform logic? My goal is to launch a VI job, but set perform logic to create the import file before the job runs. Help utility says you must use ~ or * to execute external program, but I'm not sure if it should be placed before the path or before the actual program name.


  • 2.  RE: Does anyone have an example of the command line us

    Posted 03-08-2012 05:56
    I'd be curious to see that too. Based on what you've said, i'd do it exactly opposite. Presumably, you already have a batch file or script to create the import file. I'd just add the command to run the import from the batch file. THen you could launch the batch file manually or on some regular schedule, etc.


  • 3.  RE: Does anyone have an example of the command line us

    Posted 03-08-2012 05:56
    Hmmm. Just found this answer from @AlnoorCassim . ""You do need the tilde in front to tell it's not providex. Now does it work with a tilde if you run it MAS 90 style? If so, maybe what you need to use is ~[wdx] at the very beginning of the command. This tells VI to look for the batch file relative to the workstation (IOW right now it may not even be finding your .bat file to begin with). The other way is use a ~ and a relative path like ~""..\VI\filename.bat"" and make sure the renaming inside the .bat file is happening relative to the server.


  • 4.  RE: Does anyone have an example of the command line us

    Posted 03-08-2012 06:00
    @BrettLyder That's how I'm presently doing it, but don't like it much... as you have to hard code the company code in the file, which makes testing it in another company a PITA. Thought if I reversed the process, I could launch the job from any company and not worry about modifying the batch file.


  • 5.  RE: Does anyone have an example of the command line us

    Posted 03-08-2012 06:07
    When I'm testing a script based import like that I usually just have separate lines for the live company and test company and just REM out the one i'm not using. If your import is manually launched anyway then it really doesn't matter which way you do it. When you figure it out, post the perform logic, i'd really appreciate it.


  • 6.  RE: Does anyone have an example of the command line us

    Posted 03-08-2012 07:13
    Can't easily do it. Found that even though I set perform type to On Execution, VI locks the import file... so creating an new import file generates an error. I imagine you can get fancy and incorporate PL to unlock the file, but it's not something I have time to experiment with now. I've begun using the free version of Logicity to automate exports and am quite happy with the results. The biggest benefit is that it honors the export defaults defined in Crystal... something that was problematic when generating export files with a script.


  • 7.  RE: Does anyone have an example of the command line us

    Posted 03-08-2012 07:41
    As far as running a script goes, can't you just add a command line parameter for the company code? I've done something similar with VBScript files, but I'm pretty certain that a .bat file can take a command line parameter.


  • 8.  RE: Does anyone have an example of the command line us

    Posted 03-08-2012 08:01
    @AaronClarkCPACITP Thanks. That's what I'm doing.


  • 9.  RE: Does anyone have an example of the command line us

    Posted 03-08-2012 13:07
      |   view attached
    along the same lines... I've attached the VI job supplied for importing AP invoices from Timesheets. It automatically renames the source file upon completion. The command is fired up in the perform statement. I have been unable to find the ""rename_source"" program or code. This is something I would like to incorporate in most jobs.

    Attachment(s)



  • 10.  RE: Does anyone have an example of the command line us

    Posted 03-08-2012 13:24
    Alan, are you saying it used to work? Or you are trying to? I've attached a line of script that executes upon completion that moves the source file to an archive folder and adds a system date to the name to make it a unique file. Will that work?


  • 11.  RE: Does anyone have an example of the command line us

    Posted 03-08-2012 13:42
    The VI job works. I was trying figure out how to get at the code that is fired up on the line ..\AP\AP_VIperform.M4P;rename_source. I assume ""rename_source"" is a program file of some sort. It looks like yours does something similar. this one changes the .csv source file name to ..ap20120306_XXXX_Y.CSV. It applies the date to the name. XXXX is a batch name and Y is a sequence. It would come in handy to be able to replicate it for other jobs.


  • 12.  RE: Does anyone have an example of the command line us

    Posted 02-03-2015 22:21
    @alanniergarth here is an old useful thread about renaming / moving the VI source file to a new location.