I am trying to update the Alias Item for new items created for a POS system. I need to create an Alias Item for each new item created and the Alias Item needs to be = UDF_UPC, it also needs to be a "General" type with the Alias Item Description ="SKU". I am getting to the write part and it is creating the Alias Item but, my TYPE and description or not writing. I had the keyvalue as the Itemcode my first try but both attempts produced the same result. Is the "retVal = 2 then" part incorrect, just thinking about that as i type this?
If oSession.CompanyCode = "ACT" then retVal= 0 oIMA= 0 Set oIMA = oSession.AsObject(oSession.GetObject("IM_AliasItem_bus")) sUPC = "" sIC = "" retVal = oBusObj.GetValue("UDF_UPC$", sUPC) r=oScript.DebugPrint("UPC " & sUPC) If sUPC <> "" then retVal = oBusObj.GetValue("ItemCode$", sIC) r=oScript.DebugPrint("IC: " & sIC) retVal = oIMA.SetKeyValue("AliasItemNo$", sUPC) retVal = oIMA.SetKey() If retVal = 2 then retVal = oIMA.SetValue("Type$", "G") retVal = oIMA.SetValue("AliasItemDesc$", "SKU") retVal = oIMA.Write() End If End If End If