Upgrade to Version 2020 with IM ItemCost UDF's Causes Button Script Failure

SUGGESTED

A button script has been working for 8 years that writes 4 string UDF's and the TransactionDate started failing immediately after upgrading to 2020. After getting successful returns on all the SetValue statements, the Write fails (retVal = 0). The IM ItemCost LastErrorMsg value is "Inventory Management Options indicates that Lot/Serial Expiration Dates are not enabled".

This seems to be more than a coincidence that LotSerialExpirationDate was added in 2020 and falls right behind the UDF's I'm trying to update. Anyone else have this occur?

Relevant code that's worked for 8 years:

	Set oItemCost = oSession.AsObject(oSession.GetObject("IM_ItemCost_bus"))
	
	retVal = oItemCost.SetKeyValue("ItemCode$", sItemCode)
	retVal = oItemCost.SetKeyValue("WarehouseCode$", sWarehouse)
	retVal = oItemCost.SetKeyValue("TierType$", SERTIERTYPE)
	retVal = oItemCost.SetKeyValue("GroupSort$", sLotSerialNumber)
	retVal = oItemCost.SetKey()

 	If retVal <> 1 Then
 	
 		retVal = oSession.AsObject(oSession.UI).MessageBox("","Record not found using Serial Number """ & sLotSerialNumber & """ ! retVal =" & retVal & "; ItemCode = " & sItemCode & "; WarehouseCode = " & sWarehouse)
 		
 	Else
 	
 		retVal = oItemCost.SetValue(DESCR_ONE, sDESCR_ONE)
 		retVal = oItemCost.SetValue(DESCR_TWO, sDESCR_TWO)
 		retVal = oItemCost.SetValue(MARKED_FOR, sMARKED_FOR)
 		retVal = oItemCost.SetValue(VOLTAGE, sVOLTAGE)
		retVal = oItemCost.SetValue("TransactionDate$",sTransactionDate)
		retVal = oItemCost.Write()
		
		If retVal <> 1 Then
		
			retVal = oSession.AsObject(oSession.UI).MessageBox("","Write Failed! retVal =" & retVal & " Last Error: " & oItemCost.LastErrorMsg)
			
		Else

Parents Reply Children
No Data