Posts: 166
Threads: 57
Joined: Aug 2013
Greetings,
My program selects a record grid in a CRM software that is not editable.
I need to scroll down using the keyboard down key and the whole record gets selected.
Now I need the mouse to double click the selected record to open it in a separate form.
The return key does not work on this.
Kindly advise.
Best Regards,
Philip
Posts: 12,073
Threads: 140
Joined: Dec 2002
Need to find coordinates of the selected record?
Probably it looks differently than other records. Try dialog "find image".
Also try accessible object functions. If records are accessible objects, the selected record should have different state.
Posts: 166
Threads: 57
Joined: Aug 2013
The whole record grid is an accessible object; however, the individual records are not.
What I need to accomplish here is to find and obtian all product description that involves a 'Value'. If value is '0.00' then goto next record and this needs to go on ofr as many records as is there in the record grid.
Kindly see the attached screen shots:
Attached Files
Image(s)
Best Regards,
Philip
Posts: 12,073
Threads: 140
Joined: Dec 2002
Try "get array" in dialog "window text". Array elements will contain text and coordinates, and can contain even text colors if need.
Quote: Now I need the mouse to double click the selected record to open it in a separate form.
The return key does not work on this.
try
key M
It should show a context menu.
Posts: 166
Threads: 57
Joined: Aug 2013
Ok will try...
In the meanwhile below is the code I just finish while you were on it...
Could you advise if the check I am doing on cost is correct?
Is that the way to check if an option as cost valued above zero?
Macro
Get Cost Options
, int onceFlag= 0
,
, ;repFindOptions
, ' D; 0.25 ;; Skip first line as it is vehicle base price
,
, scan "color:0xFF9933" child ( "" "KCMLGridPad_32" w3 0x0 "id=100" 2 ) 0 1 | 2 | 16
, dou ; 1
,
, int w5= win ( "Vehicle Specification Line Detail" "KCMLMasterForm_32" )
, Acc a2.Find ( w5 "CLIENT" "" "class=KCMLDBEdit_32[]id=26722[]xy=451 264" 0x1004 )
,
, int cost= a2.Value
, Acc a5.Find ( w5 "TEXT" "" "class=KCMLEdit32[]xy=256 40[]state=0x100040 0x20000040" 0x1004 )
, str costOptionName= a5.Value
, if cost<> "0.00"
,, act w1
,, if onceFlag= 0
,,, ' R( # 14 )
,,, onceFlag= 1
,, key ( costOptionName)
,, ' R
,, key ( cost)
,
, int w4= win ( "Vehicle Specification Line Detail" "KCMLMasterForm_32" )
, Acc a6.Find ( w4 "PUSHBUTTON" "Cancel" "class=KCMLButton_32[]id=2[]xy=603 63" 0x1005 )
, a6.Mouse ( 1 ); 0.5
, goto repFindOptions
Best Regards,
Philip
Posts: 12,073
Threads: 140
Joined: Dec 2002
Posts: 166
Threads: 57
Joined: Aug 2013
So is the below usage correct?
Macro
Get Cost Options
Best Regards,
Philip
Posts: 12,073
Threads: 140
Joined: Dec 2002
if val(cost 2)
is the same as
if val(cost 2)!=0
Posts: 166
Threads: 57
Joined: Aug 2013
I am somehow not able to get the below code to work; it does not enter the condition when true:
Macro
Get Cost Options
, if val ( strCost 2 ) != 0
,, mes "in now"
,, act w1
,, if onceFlag= 0
,,, ' R( # 14 )
,,, onceFlag= 1
,, key ( costOptionName)
,, ' R
,, key ( cost)
Best Regards,
Philip
Posts: 12,073
Threads: 140
Joined: Dec 2002
put this before to see what is in the variable
to test
Macro
Macro2475
str strCost= "1.00"
if val ( strCost 2 ) != 0
, mes "in now"
Posts: 166
Threads: 57
Joined: Aug 2013
I believe the error is in the below code:
I am supposed to obtain the invoice value in this manner.
But after I tested for the value output, it just gives me zero even for a higher value.
Macro
Get Cost Options
, int w5= win ( "Vehicle Specification Line Detail" "KCMLMasterForm_32" )
, Acc a2.Find ( w5 "CLIENT" "" "class=KCMLDBEdit_32[]id=26722[]xy=451 264" 0x1004 )
,
, double cost= a2.Value
, out cost
, str strCost= cost
Best Regards,
Philip
Posts: 12,073
Threads: 140
Joined: Dec 2002
Maybe the text is not in value, but in name or description or nowhere. You can see it in dialog "Find accessible object".
out a2.Value
out a2.Name
out a2.Description
Posts: 12,073
Threads: 140
Joined: Dec 2002
You forgot to convert string (a2.Value) to number.
double cost=val(a2.Value 2)
Posts: 166
Threads: 57
Joined: Aug 2013
Just tried that. Still gives me a zero value
Macro
Get Cost Options
, ;repFindOptions
, ' D; 0.25 ;; Skip first line as it is vehicle base price
,
, scan "color:0xFF9933" child ( "" "KCMLGridPad_32" w3 0x0 "id=100" 2 ) 0 1 | 2 | 16
, dou ; 1
,
, int w5= win ( "Vehicle Specification Line Detail" "KCMLMasterForm_32" )
, Acc a2.Find ( w5 "CLIENT" "" "class=KCMLDBEdit_32[]id=26722[]xy=451 264" 0x1004 )
,
, double cost= val ( a2.Value 2 )
, out cost
, str strCost= cost
,
, Acc a5.Find ( w5 "TEXT" "" "class=KCMLEdit32[]xy=256 40[]state=0x100040 0x20000040" 0x1004 )
, int checkOption = StrCompare ( a5.Value costOptionName)
, if checkOption= 0 ;;If the option selected currently is the same as before then exit loop
,, out a5.Value
,, out costOptionName
,, int w6= win ( "Vehicle Specification Line Detail" "KCMLMasterForm_32" )
,, Acc a7.Find ( w6 "PUSHBUTTON" "Cancel" "class=KCMLButton_32[]id=2[]xy=603 63" 0x1005 )
,, a7.Mouse ( 1 ); 0.5
,, continue
, costOptionName= a5.Value
,, out F "''{ strCost}''"
, if val ( strCost 2 ) != 0
,, mes "in now"
,, act w1
,, if onceFlag= 0
,,, ' R( # 14 )
,,, onceFlag= 1
,, key ( costOptionName)
,, ' R
,, key ( cost)
Best Regards,
Philip
Posts: 166
Threads: 57
Joined: Aug 2013
Got it Gintaras,
It was a2.Name not value...
Thanks for the pointers
Best Regards,
Philip