Pinned topic How to set the cursor position to a specific field in a Macro
I am recording a macro and would have to do the following.
1. I have to navigate to set the cursor to a particular field on the screen but that field can appear anywhere on the screen and is not constant. However the fields can be identified based on the text which does not change.
2. For some of the non-constant fields on the screen the selection happens before the "field text" while for others it happens after the "field text"
s FieldOptionA (selection is before the Fieldtext)
FieldOptionB s (selection is after the Fieldtext)
Let me know your thoughts on how we could do it
Thanks in Advance,
george.baker 270001YCQD277 PostsACCEPTED ANSWER
Re: How to set the cursor position to a specific field in a Macro2013-01-28T19:03:15Z in response to SystemAdminUse the $HMLPSUtil$ library. Search the presentation space for the location of the "field text". Get the row and column position of the "field text" found. Calculate the location of the input field using macro variables.
tmparker 120000EHB3454 PostsACCEPTED ANSWER
Re: How to set the cursor position to a specific field in a Macro2013-01-29T18:51:33Z in response to george.bakerHere is a sample piece of a macro that shows a search being done based on a string entered from a prompt and stored in a macro variable. Then the location where the string is found is used to determine the row where a value will be input. In this case the column is fixed since we already knew that location.
<actions> <prompt assigntovar= "$searchStr$" clearfield= "false" col= "0" default= "" description= "" encrypted= "false" len= "80" movecursor= "false" name= "'searchValue'" required= "false" row= "0" title= "" varupdateonly= "true" xlatehostkeys= "true"/> <varupdate name= "$loc$" value= "$HMLPSUtil.searchString($searchStr$)$"/> < if condition= "$loc$ > 0"> <varupdate name= "$rowLoc$" value= "$HMLPSUtil.convertPosToRow($loc$)$"/> <input col= "22" encrypted= "false" movecursor= "true" row= "$rowLoc$" value= "$rowLoc$" xlatehostkeys= "true"/> </if> </actions>
Just wanted to show a quick code sample to make it a little clearer how the HMLPSUtil is used in a macro.
RavikanthChavali 2700036D4W11 PostsACCEPTED ANSWER
Re: How to set the cursor position to a specific field in a Macro2013-05-12T20:51:52Z in response to SystemAdmin
I tried to search for this question; I was searching based on the author as i could not recollect the tags i have given. This is a topic I started, and suprisingly it shows SystemAdmin as the author. I recoginzed it based on the signature on the original message. Just wanted to clarify if this is normal and expected behavior? and any insight as to why this would/will happen is appreciated?
It will be very helpful if we could find the questions that a user posted or replied, somewhere in their profile... Please let us know if there is an easy way to get to those questions.
Thank you!Updated on 2013-05-13T13:46:46Z at 2013-05-13T13:46:46Z by RavikanthChavali