I have this script that someone else wrote for us, that updates a UDF in [dbo_SO_SalesOrderHeader] and adds any new values to a UDT. I want to use some of this same script to do the same thing for PO's, but only copy the Ship Via Desc to a UDF. Can anyone help with this? I can take out what I think is for updating the UDT but don't know what the values should be for being done in the PO module. oShip = 0 oShadow = 0 retVal = 0 rec = 0 SoCode ="" SoDesc = "" oShip = oSession.GetObject("SO_SHIPPINGRATE_SVC") If oShip 0 then Set oShip = oSession.AsObject(oSHIP) end if oShadow = oSession.GetObject("CM_UDTMaint_bus","SO_UDT_Shadow_Via") if oShadow 0 then Set oShadow = oSession.AsObject(oShadow) end if retVal = oShip.MoveFirst() While not (cBool(oShip.Eof)) retVal = oShip.GetValue("ShippingCode$",SoCode) retVal = oShip.GetValue("ShippingCodeDesc$",SoDesc) retVal=oShadow.SetKey(SoCode) if retVal 0 then retVal = oShadow.SetValue("UDF_SHADOW_VIA_CODE$",SoCode) retVal = oShadow.SetValue("UDF_VIA_DESC$",SoDesc) retVal = oShadow.Write() if retVal 0 then rec = rec + 1 end if end if oShip.MoveNext wend
↧