I'm using UIA to navigate Salesforce, and for the first time EVER with Salesforce, I'm actually having a lot of success! However, I'm stuck on the script below.
I'm trying to automate closing a case, and the chosen ListItem value in the second combobox depends on what the ListItem value is in the first combobox. I get the value of the first one and use it in a Switch statement for the second. However, when I run the script, it just pretends to perform an action from the Switch statement and moves on to finish the script.
Thinking that the menu must somehow be getting 'closed' while the Switch statement is happening, I tried moving the "Case Closed Reason" combobox invoke statement to inside that case -- but the same thing happened.
I have tried adding sleeps around all the commands for the 2nd combobox -- made absolutely no difference.
However -- if I run the script again immediately, the script works exactly as desired. How can I get it to run right the first time??
I'm trying to automate closing a case, and the chosen ListItem value in the second combobox depends on what the ListItem value is in the first combobox. I get the value of the first one and use it in a Switch statement for the second. However, when I run the script, it just pretends to perform an action from the Switch statement and moves on to finish the script.
Thinking that the menu must somehow be getting 'closed' while the Switch statement is happening, I tried moving the "Case Closed Reason" combobox invoke statement to inside that case -- but the same thing happened.
I have tried adding sleeps around all the commands for the 2nd combobox -- made absolutely no difference.
However -- if I run the script again immediately, the script works exactly as desired. How can I get it to run right the first time??
CODE:
!c::;close Overdue case - paid
{
cUIA := ""
cUIA := UIA_Browser("| Case | Salesforce")
y := cUIA.GetCurrentDocumentElement()
;'open' case to edit
c := y.FindElement({Type:"button", Name:"Edit Status"}).Click()
;get value of first combobox & then change it to 'closed'
status := y.WaitElement({Type:"ComboBox", Name:"Status - Current Selection",cs:0,mm:2})
statuss := status.Value
status.Invoke()
y.WaitElement({Type:"ListItem", Name:"Closed"}).Invoke()
;'open' 2nd combobox & select option based on value of 1st combobox
y.WaitElement({Type:"ComboBox", Name:"Case Closed Reason",cs:0,mm:2}).Invoke()
Switch statuss
{
case "Stage 1": y.WaitElement({Type:"ListItem", Name:"Paid Stage 1"}).Invoke()
case "Stage 2": y.WaitElement({Type:"ListItem", Name:"Paid Stage 2"}).Invoke()
case "Stage 3": y.WaitElement({Type:"ListItem", Name:"Paid Stage 3"}).Invoke()
case "Stage 4": y.WaitElement({Type:"ListItem", Name:"Paid Stage 4"}).Invoke()
case "Stage 5": y.WaitElement({Type:"ListItem", Name:"Paid Stage 5"}).Invoke()
case "Stage 6": y.WaitElement({Type:"ListItem", Name:"Paid Stage 6"}).Invoke()
}
MsgBox "done"
tog := y.FindElement({Type:"Checkbox", Name:"Do Not Send Case Closed Email"})
If (tog.toggleState = "0")
{
tog.Toggle()
}
cUIA := ""
}
Statistics: Posted by shipaddicted — Today, 18:36