rosaz Posted August 31, 2009 Posted August 31, 2009 I'm trying to select a field within a BMC Remedy field, but the GiveFieldFocus command which worked with the other fields isn't working with this one (called "Detailed Description"). I'm not sure if its because its a diary field, or if the field name is something different than it shows up as on the form, but I'd be very grateful for any suggestions! Here's the code I'm using: 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") ; Initialize a COM error handler $oRemedy = ObjGet("", "Remedy.User.1") $oRemedyForm = $oRemedy.OpenForm($iSession, "pscars01.ps.net", "Request Management", 1, True) $oDetailedDescription = $oRemedyForm.GiveFieldFocus("Detailed Description") Thank you!
exodius Posted September 8, 2009 Posted September 8, 2009 We're using BMC Remedy 7 and under C:\Program Files\AR System\*Your Organization* there are several folders that correspond to the different forms we use. In each of those folders there's a .arf file that seems to have the field id and name of each field on the forms... Maybe check there? I was able to find that a field that labeled "Phone" was actually called "Requester Phone" by checking this file. Where I put *Your Organization* above should be the folder that isn't User. (There's a folder C:\Program Files\AR System\User that isn't the one you want).
someone Posted September 8, 2009 Posted September 8, 2009 What exodius said is your best bet because it can give you the names of all the fields, often if I just need one field's ID I'll create and save a Remedy macro with that field in it, then open that macro up in notepad and it will show the ID of the field. You can then use GiveFieldFocusById if you go that route. While ProcessExists('Andrews bad day.exe') BlockInput(1) SoundPlay('Music.wav') SoundSetWaveVolume('Louder') WEnd
exodius Posted September 8, 2009 Posted September 8, 2009 (edited) Here's an example of a section from one of the .arf files (note that there can be a space after the name like displayed, if there is one, it has to be in your script): field { id : 536870964 name : Requester Phone datatype : 4 create-mode : 1 option : 1 maxlength : 20 menu-style : 1 qbe-match-op : 2 fulltext-optns : 0 help-text : This is a required field. Enter Requester's Phone number in this format 123-456-7890. Must be at least 7 digits. } Edited September 8, 2009 by exodius
exodius Posted September 8, 2009 Posted September 8, 2009 For additional Reference, check out AR System Automation section of the the C API Reference guide, you can find a copy of it here.
covaks Posted September 15, 2009 Posted September 15, 2009 What does the .1 refer to when you use objget? Is it the instance of the program? For example, If I had the remedy client running twice, could I use Remedy.User.1 to reference the first instance, and Remedy.User.2 the second? I have a right click menu I built for remedy that works with two instances, but I have to start the second instance inside the script by pointing objget to aruser.exe. As I thought there was no other simple way to get an object for that second instance. I've always just done it with "Remedy.User", and if it doesn't refer to the instance then what is the difference? (eg:) $objRemedy = ObjGet("", "Remedy.User") $objForm = $objRemedy.GetActiveForm() $objField = $objForm.GetField("Call Status") $objField.value = "Work In Progress" $objField = $objForm.GetField("Call Details") $objField.Value = "Investigating.." ControlSend($hWnd, "", "", "^y") P.S. An alternative way to easily find correct field names/ids, there are several programs out there in the wild that can be used as well. There's a basic one here, it doesn't have some of the fancy tools as others, but it's quick, sorts, and easy to view: http://ars.davoid.net/Tools/ARAllFields/ARAllFields.htm
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