infor.com
concierge
infor u
developer portal
Home
Groups
VISUAL - Enterprise Customer Community
Running visual macros from outside visual
unknown
Does anyone know if it is possible to run Visual ERP tasks through an external scheduler? I would like to run a visual macro from the windows command line.
For example is there something like: "VM.exe -runmacro macroname"?
Find more posts tagged with
VISUAL - Enterprise General Discussions
Comments
unknown
It is possible, if the Visual module is running - if the Visual module is not running, but the Visual main menu is running, you could remotely start the module if necessary. What you need is a "helper" application that can remotely click the Visual menus - I wrote one of those helper programs called ActivateMenu and made it freely available on the Yahoo Visual group and the VMNEUG site:
tech.groups.yahoo.com/.../
www.vmneug.org/index.php
For instance, assume that you had a macro named VMPURENT_YesNo.vms that contained the following:
'------------------------------------
Dim intResult
intResult = MsgBox("Did you spill the beans", vbYesNo, "Answer Me")
If intResult = vbYes Then
MsgBox "Why did you spill the beans, the bean counters are upset now."
Else
MsgBox "Thank you for not spilling the beans."
End If
'------------------------------------
If you wanted to execute that macro, you could do so from another Visual macro (possibly in another Visual module) with the following Visual macro code (assuming that the helper program is stored in the C:Visual folder):
'------------------------------------
Dim objShell
Dim strCommandLine
Set objShell = CreateObject("WScript.Shell")
'Command line parameters for ActivateMenu.exe
'"Partial Window Title" DelaySeconds "MainMenuTitle" "MenuItemTitle" "Optional_MenuItemSubTitle"
strCommandLine = """Purchase Order Entry"" 1 ""&Macros"" ""YesNo"""
objShell.Run ("C:VisualActivateMenu.exe " & strCommandLine)
'------------------------------------
Now the fun part, change the extension of the above Visual macro that runs the ActivateMenu.exe program from .vms to .vbs and you can execute the Visual macro from a Windows command line:
C:>cscript test.vbs
Taking it out one step further, you could directly call the ActivateMenu command from the Windows command line to execute a macro in a module with the following command line:
C:VisualActivateMenu.exe "Purchase Order Entry" 1 "&Macros" "YesNo"
The 1 in the above line tells the ActivateMenu program to wait 1 second before clicking the menu - that can be changed to a 0 if you are not running the program from a Visual macro.
Charles Hooper
unknown
Thank you so much for your help. I have been browsing your tools on the yahoo groups and finding great things! My end goal is to schedule the scheduler and I have found your Tech Gadgets and other cool stuff presentation complete with the scheduling utility for the Visual concurrent scheduler. I plan to spend some time playing with it. Thanks, this is very useful stuff.
CPQ Product Name Lineage.docx
Quick Links
All Categories
Recent Posts
Activity
Unanswered
Groups
Help
Popular Tags
Infor Lawson Human Resources Group - Discussion
Infor Lawson Technology Group - Discussion
VISUAL - Enterprise General Discussions
Infor Lawson Supply Chain Management - Discussion
Process Automation (IPA) - General Discussions
Pegasus - Partner General Discussions
**General Discussion**
Infor Lawson Supply Chain Group - Discussion
Infor Lawson Financials Group - Discussion
Infor EPM Discussions