Hexboy Posted October 13, 2011 Posted October 13, 2011 Hi, Have only been using autoit for a day or so, I am attempting automation with fields in BMC Remedy, I am able to connect and load forms but am getting a return of not enough parameters when I use oShortDescription = $oRemedyForm.GiveFieldFocus("WorkLog Action Status") and have also tried $queryresult = $oRemedyForm.Query(GUICtrlRead($Input2)) but get an exception error. I know I'm not far off but would appreciate some help. Here is the code of the whole thing: expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile=..\..\..\RT.exe #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $g_eventerror = 0 ; to be checked to know if com error occurs. Must be reset after handling. Global $oRemedy Global $iSession = 0 $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") ; Install a custom error handler #Region ### START Koda GUI section ### Form=D:\Users\courtom\Desktop\GUI\Forms\Form1.kxf $Form1 = GUICreate("Remedy Form Tool", 293, 108, 347, 293) $Button2 = GUICtrlCreateButton("Inject", 208, 56, 73, 41) $Button1 = GUICtrlCreateButton("Run Query", 208, 8, 73, 41) $Input1 = GUICtrlCreateInput("FORM ID", 8, 16, 193, 21) $Input2 = GUICtrlCreateInput("Inject Into Form?", 8, 64, 193, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $oRemedy = ObjGet("", "Remedy.User.1") $oRemedyForm = $oRemedy.OpenForm($iSession, "GSP-AUHT-GR01", GUICtrlRead($Input1), 1, True) Case $Button2 $queryresult = $oRemedyForm.Query(GUICtrlRead($Input2)) EndSwitch WEnd Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"","We intercepted a COM Error !" & @CRLF & _ "Number is: " & $HexNumber & @CRLF & _ "Windescription is: " & $oMyError.windescription ) $g_eventerror = 1 Endfunc THANKS!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now