I recorded a macro which goes from the sales
transaction entry window to the Items (lookup) window. It then goes
back to the sales transaction entry window, pulls up the sales customer
detail entry window, clicks on the customer button, copies the customer
id, hits "ok" to close the window, hits "ok" to close the sales
customer detail entry window, runs a search on the customer id to
return items available to that customer.
The purpose of the
macro is so our sales entry team only can select items that should be
available for the current customer. The problem is the macro is using
the value from when the macro was recorded (ADF-CARROLT-CAR) and not
the customer id value for the current record. Any suggestions?
Here is the code for the macro:
# DEXVERSION=10.0.313.0 2 2
CheckActiveWin dictionary 'default' form 'SOP_Entry' window 'SOP_Entry'
MoveTo field 'Lookup Button 7'
ClickHit field 'Lookup Button 7'
NewActiveWin dictionary 'SmartList' form 'IV_Item_Number_Lookup' window 'IV_Item_Number_Lookup'
ActivateWindow dictionary 'SmartList' form 'IV_Item_Number_Lookup' window 'IV_Item_Number_Lookup'
ActivateWindow dictionary 'SmartList' form 'IV_Item_Number_Lookup' window 'IV_Item_Number_Lookup'
ActivateWindow dictionary 'SmartList' form 'IV_Item_Number_Lookup' window 'IV_Item_Number_Lookup'
ActivateWindow dictionary 'default' form 'SOP_Entry' window 'SOP_Entry'
MoveTo field 'Expansion Button 4'
ClickHit field 'Expansion Button 4'
NewActiveWin dictionary 'default' form 'SOP_Customer_Detail_Entry' window 'SOP_Customer_Detail_Entry'
MoveTo field 'Customer Button'
ClickHit field 'Customer Button'
NewActiveWin dictionary 'default' form 'RM_Customer_Inquiry' window 'RM_Customer_Inquiry'
CommandExec form BuiLtin command cmdEditCopy
MoveTo field 'OK Button'
ClickHit field 'OK Button'
NewActiveWin dictionary 'default' form 'SOP_Customer_Detail_Entry' window 'SOP_Customer_Detail_Entry'
MoveTo field 'OK Button'
ClickHit field 'OK Button'
ActivateWindow dictionary 'default' form 'SOP_Entry' window 'SOP_Entry'
ActivateWindow dictionary 'default' form 'SOP_Entry' window 'SOP_Entry'
ActivateWindow dictionary 'default' form 'SOP_Entry' window 'SOP_Entry'
ActivateWindow dictionary 'SmartList' form 'IV_Item_Number_Lookup' window 'IV_Item_Number_Lookup'
MoveTo field 'ASI_LU_View_Button' item 1 # 'All Item Numbers'
ClickHit field 'ASI_LU_View_Button' item 2 # 'Customer Items'
MoveTo field 'PB_Advanced_Search'
ClickHit field 'PB_Advanced_Search'
NewActiveWin dictionary 'SmartList' form 'ASI_Advanced_Search' window 'ASI_Explorer_Criteria'
MoveTo field 'ASI_Search_Lookup_Button'[1]
ClickHit field 'ASI_Search_Lookup_Button'[1]
NewActiveWin dictionary 'SmartList' form 'ASI_Explorer_Fields' window 'ASI_Explorer_Fields'
MoveTo field '(L) LV_Fields' item 0 # ''
ClickHitMS field '(L) LV_Fields' item 4 # 'Customer Number'
SelChanged field '(L) LV_Fields'
DblClickHit field '(L) LV_Fields' item 4 # 'Customer Number'
NewActiveWin dictionary 'SmartList' form 'ASI_Advanced_Search' window 'ASI_Explorer_Criteria'
MoveTo field 'ASI_Start_String'[1]
CommandExec form BuiLtin command cmdEditPaste
TypeTo field 'ASI_Start_String'[1],'ADF-CARROLT-CAR'
MoveTo field 'OK Button K'
ClickHit field 'OK Button K'
NewActiveWin dictionary 'SmartList' form 'IV_Item_Number_Lookup' window 'IV_Item_Number_Lookup'