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
  • 0
    SUGGESTED

    Seems like the transaction date is somehow tied to the expiration date because my vanilla 2020 test install has the fields in this order.

    And attempting to set just the transaction date results in the Write failing and the same message about expiration dates not being enabled.

    UPDATE: attempted to set the tier group and it passed but the write failed with the same message about expiration dates not being enabled so it seems the IM_ItemCost_Bus object is blocking all attempts to update a record in this manner if the option is not enabled.  Not sure if working as designed.  May need to open a case or hope we get someone's attention at sage.

Reply
  • 0
    SUGGESTED

    Seems like the transaction date is somehow tied to the expiration date because my vanilla 2020 test install has the fields in this order.

    And attempting to set just the transaction date results in the Write failing and the same message about expiration dates not being enabled.

    UPDATE: attempted to set the tier group and it passed but the write failed with the same message about expiration dates not being enabled so it seems the IM_ItemCost_Bus object is blocking all attempts to update a record in this manner if the option is not enabled.  Not sure if working as designed.  May need to open a case or hope we get someone's attention at sage.

Children