infor.com
concierge
infor u
developer portal
Home
Groups
VISUAL - Enterprise Customer Community
AutoIT
unknown
Does anyone have examples of using AutoIt in Visual to automate daily task (Costing Utilities). I can not seem to get it to work.
XA Virtual Summit-Foundation for the future.mp4
Find more posts tagged with
VISUAL - Enterprise General Discussions
Comments
unknown
If anyone has MRP also, I would be grateful. The one I created is working unreliably.
unknown
What do you mean, the MRP you created is working unreliably? Please explain.
0712131256598360.doc
smacfhionnlaoich
This is a script I wrote to run Global every morning before everyone comes in. You should be able to modify it sufficiently to perform costing tasks. Let me know if you need additional help.
#Include
;Start - Defines log file location and starts log
$logfile = FileOpen("c:ScriptsAutoIT.log",1)
FileWriteLine ($logfile, "")
FileWriteLine ($logfile, _Now() & " Starting Global Run Script")
;Start Visual & Wait for Logon screen
Run("\tiesqlVisualVISUALEnterpriseVISUALManufacturingVM.EXE")
sleep(1500)
$ret = WinWait("Login","",1)
if $ret = 0 Then
MsgBox(0,"error","The Window did not open")
Exit
EndIf
AutoItSetOption("SendKeyDelay", 50)
;Enter Logon info
sleep (2000)
ControlSend ("Login","","","SYSADM")
ControlSend ("Login","","","{TAB}")
ControlSend ("Login","","","XXXXXX")
ControlSend ("Login","","","{ENTER}")
WinWait ("Infor ERP VISUAL Enterprise - VMFG/SYSADM")
WinActivate ("Infor ERP VISUAL Enterprise - VMFG/SYSADM")
Send ("!u")
sleep(250)
Send ("h")
WinWait ("Concurrent Scheduler - Infor ERP VISUAL Enterprise - VMFG")
sleep (1000)
WinActivate ("Concurrent Scheduler - Infor ERP VISUAL Enterprise - VMFG")
send ("{Down}")
sleep(250)
Send ("!f")
sleep(250)
Send ("d")
WinActivate ("Global schedule")
ControlCommand ("Global schedule", "", "Gupta:GPRadio2", "Check","")
ControlClick ("Global schedule", "", "Button1")
WinWaitClose ("Global schedule - STANDARD")
Sleep(4000)
FileWriteLine ($logfile, _Now() & " Ending Global Run Script")
FileClose($logfile)
WinClose("Infor ERP VE - VMFG/SYSADM")
unknown
Sweet! Which part controls the time it runs?
smacfhionnlaoich
When you compile the code it creates an exe file.
You then set up Windows Task Scheduler to run it (the exe file) to whatever schedule you like.
In this specific case it runs M-F 0500.
unknown
the script I made in autoIT to run MRP(Material Planning Window)
run("\lkinforInforVISUALEnterpriseVISUALManufacturingVMPLNWIN.EXE", "C:InforVISUAL EnterpriseVISUAL Manufacturing")
WinWaitActive("Material Planning Window - Infor ERP VISUAL Enterprise - SQLDEV1 - [Material Planning Window]")
WinSetState("Material Planning Window - Infor ERP VISUAL Enterprise - SQLDEV1 - [Material Planning Window]","test",
@SW_MAXIMIZE)
send("!F")
sleep(5000)
send("q")
WinWaitActive("VISUAL MRP(tm) - Material Requirements Planning")
send("{UP}")
SEND("{TAB 7}")
send("{SPACE}")
send("!O")
sleep(7200000)
winclose("Material Planning Window - Infor ERP VISUAL Enterprise - SQLDEV1 - [Material Planning Window]")
Seems to not work everytime it is run. at 1am.
unknown
instead of sleep(7200000) try
WinWaitActive("VISUAL MRP(tm) - Material Requirements Planning")
unknown
I'll try it.
unknown
I've heard that if the account that runs the AutoIT script isn't logged onto a session on the server the script won't run? Not sure if that is true but I was told, "don't log in through remote desktop otherwise this will stop working".
0904080939293831.xls
ztrue
AutoIT has some limitations. Basically, it cannot "unlock" the computer.
Our work-around for this is a virtual machine that is set to auto-login and run the script via task scheduler. I have also disabled sleep and screen saver functions. This basically keeps the console logged in and running so that the task scheduler can kick the script off without any issue.
Quick Links
All Categories
Recent Posts
Activity
Unanswered
Groups
Help
Popular Tags
Infor Lawson Human Resources Group - Discussion
Infor Lawson Technology Group - Discussion
General Discussions
VISUAL - Enterprise General Discussions
Infor Lawson Supply Chain Management - Discussion
Process Automation (IPA) - General Discussions
Pegasus - Partner General Discussions
Infor Lawson Supply Chain Group - Discussion
Infor Lawson Financials Group - Discussion
Infor EPM Discussions