Forum Discussion
At some point, TC slows to a crawl while running one of these two subroutines. However, I can get around the problem by commenting out previous subroutines and allowing these to run so I'm not sure the problem is in the VBScript itself:
Sub AddWorkRule(WRName, WRDesc, WRType)
Set Pro = Sys.Process("tcs")
Set WFMWin = Pro.Window("TfrmMainNavigator", "*", 1)
Call WFMWin.keys("^[Ins]")
Set Savebtn = Pro.Window("TfrmEditWorkRule", "Work Rule", 1).Window("TWFMToolBar", "", 1).Window("TWFMPanel", "", 2)
Call Savebtn.Click
Set OKbtn = Pro.Window("#32770", "Aspect Workforce Management", 1).Window("Button", "OK", 1)
Call OKbtn.Click
Set Rule = Pro.Window("TfrmEditWorkRule", "Work Rule", 1).Window("TWFMPageControl", "", 1).Window("TWFMTabSheet", "General", 1).Window("TWFMPanel", "", 2).Window("TWFMItemEntry", "", 1).Window("TcxCustomInnerTextEdit", "", 1)
Call Rule.keys(WRType)
Call Savebtn.Click
Set OKbtn = Pro.Window("#32770", "Aspect Workforce Management", 1).Window("Button", "OK", 1)
Call OKbtn.Click
Set Desc = Pro.Window("TfrmEditWorkRule", "Work Rule", 1).Window("TWFMPageControl", "", 1).Window("TWFMTabSheet", "General", 1).Window("TWFMPanel", "", 2).Window("TWFMTextEdit", "", 2).Window("TcxCustomInnerTextEdit", "", 1)
Call Desc.keys(WRDesc)
Call Savebtn.Click
Set OKbtn = Pro.Window("#32770", "Aspect Workforce Management", 1).Window("Button", "OK", 1)
Call OKbtn.Click
Set Name = Pro.Window("TfrmEditWorkRule", "Work Rule", 1).Window("TWFMPageControl", "", 1).Window("TWFMTabSheet", "General", 1).Window("TWFMPanel", "", 2).Window("TWFMTextEdit", "", 1).Window("TcxCustomInnerTextEdit", "", 1)
Call Name.keys(WRName)
Call Savebtn.Click
Set Yesbtn = Sys.Process("tcs").Window("#32770", "Aspect Workforce Management", 1).Window("Button", "&Yes", 1)
Call Yesbtn.ClickEnd sub
Sub EditWorkRuleMinContin(SearchName, WRSuperstate, WRTimeOff, WRWinType, WRMovingHours, WRFiscalCal)
Set Pro = Sys.Process("tcs")
Set WFMWin = Pro.Window("TfrmMainNavigator", "*", 1)
Call WFMWin.keys("^f")
Set Scope = Pro.Window("TGridFindForm", "Find", 1).Window("TWFMPanel", "", 1).Window("TWFMPanel", "", 1).Window("TWFMGroupBox", "Scope", 3).Window("TWFMComboBox", "", 1)
Call Scope.keys("Name")
Set FromBegin = Pro.Window("TGridFindForm", "Find", 1).Window("TWFMPanel", "", 1).Window("TWFMPanel", "", 1).Window("TWFMGroupBox", "Origin", 1).Window("TWFMRadioButton", "From beginning", 1)
Call FromBegin.Click
Set Text = Pro.Window("TGridFindForm", "Find", 1).Window("TWFMPanel", "", 1).Window("TWFMPanel", "", 1).Window("TWFMTextEdit", "", 1).Window("TcxCustomInnerTextEdit", "", 1)
Call Text.keys(SearchName)
Set OKbtn = Pro.Window("TGridFindForm", "Find", 1).Window("TWFMPanel", "", 2).Window("TWFMPanel", "", 1).Window("TWFMButton", "OK", 3)
Call OKbtn.Click
Delay(3000)
Call WFMWin.keys("[Enter]")
Delay(3000)
Set Configbtn = Pro.Window("TfrmEditWorkRule", "Work Rule (*)", 1).Window("TWFMPageControl", "", 1).Window("TWFMTabSheet", "General", 1).Window("TWFMPanel", "", 1).Window("TWFMButton", "Configure...", 1)
Call Configbtn.Click
Set Superstate = Pro.Window("TFormMinSuperstateTimeOffInWindowConfig", "Minimum Continuous Time Off in Window", 1).Window("TWFMPanel", "", 1).Window("TWFMPanel", "", 1).Window("TWFMPanel", "", 2).Window("TWFMItemEntry", "", 1).Window("TcxCustomInnerTextEdit", "", 1)
Call Superstate.keys(WRSuperstate)
Set TimeOff = Pro.Window("TFormMinSuperstateTimeOffInWindowConfig", "Minimum Continuous Time Off in Window", 1).Window("TWFMPanel", "", 1).Window("TWFMPanel", "", 1).Window("TWFMPanel", "", 2).Window("TWFMLongDuration", "", 1).Window("TcxCustomInnerTextEdit", "", 1)
Call TimeOff.keys(WRTimeOff)
if WRWinType = ("moving") then
Set Moving = Pro.Window("TFormMinSuperstateTimeOffInWindowConfig", "Minimum Continuous Time Off in Window", 1).Window("TWFMPanel", "", 1).Window("TWFMPanel", "", 1).Window("TWFMPanel", "", 1).Window("TWFMGroupBox", "Time window", 1).Window("TWFMRadioButton", "Moving window", 1)
Call Moving.Click
Set Hours = Pro.Window("TFormMinSuperstateTimeOffInWindowConfig", "Minimum Continuous Time Off in Window", 1).Window("TWFMPanel", "", 1).Window("TWFMPanel", "", 1).Window("TWFMPanel", "", 1).Window("TWFMGroupBox", "Time window", 1).Window("TWFMLongDuration", "", 1).Window("TcxCustomInnerTextEdit", "", 1)
Call Hours.keys(WRMovingHours)
elseif WRWinType = ("fiscal") then
Set Fiscal = Pro.Window("TFormMinSuperstateTimeOffInWindowConfig", "Minimum Continuous Time Off in Window", 1).Window("TWFMPanel", "", 1).Window("TWFMPanel", "", 1).Window("TWFMPanel", "", 1).Window("TWFMGroupBox", "Time window", 1).Window("TWFMRadioButton", "Fiscal period", 2)
Call Fiscal.Click
Set FiscalCal = Pro.Window("TFormMinSuperstateTimeOffInWindowConfig", "Minimum Continuous Time Off in Window", 1).Window("TWFMPanel", "", 1).Window("TWFMPanel", "", 1).Window("TWFMPanel", "", 1).Window("TWFMGroupBox", "Time window", 1).Window("TWFMItemEntry", "", 1).Window("TcxCustomInnerTextEdit", "", 1)
Call FiscalCal.keys(WRFiscalCal)
end if
Set OKbtn = Pro.Window("TFormMinSuperstateTimeOffInWindowConfig", "Minimum Continuous Time Off in Window", 1).Window("TWFMPanel", "", 2).Window("TWFMPanel", "", 1).Window("TWFMButton", "OK", 3)
Call OKbtn.Click
Set Savebtn = Pro.Window("TfrmEditWorkRule", "Work Rule (*)", 1).Window("TWFMToolBar", "", 1).Window("TWFMPanel", "", 2)
Call Savebtn.ClickEnd sub
Related Content
Recent Discussions
- 4 hours ago