sUDF_WalmartApproved = """"
sUDF_Retailers_Item_No = """"
sVendor = """"
sDivNo = """"
sItemNo = """"
'Only work with user is in company TST
If oSession.CompanyCode <> ""TST"" Then
Exit Sub
End If
retVal = oBusObj.GetValue(""ItemCode$"",sItemNo)
if Not(IsObject(oItem)) then
set oItem = oSession.AsObject(oSession.GetObject(""CI_ItemCode_bus""))
end if
retVal = oItem.SetIndex(""KPRIMARY"")
retVal = oItem.Find(sItemNo)
retVal = oItem.GetValue(""UDF_RETAILERS_ITEM_NO$"",sUDF_Retailers_Item_No)
if sUDF_Retailers_Item_No = ""WAL05"" then
retVal = oHeaderObj.GetValue(""VendorNo$"", sVendor)
retVal = oHeaderObj.GetValue(""APDivisionNo$"", sDivNo)
if Not(IsObject(oVendor)) then
set oVendor = oSession.AsObject(oSession.GetObject(""AP_Vendor_bus""))
end if
retVal = oVendor.SetIndex(""KPRIMARY"")
retVal = oVendor.Find(sDivNo & sVendor)
retval = oVendor.GetValue(""UDF_WALMARTAPPROVED$"", sUDF_WalmartApproved)
if sUDF_WalmartApproved = ""Y"" then
' Fall through - no error
Else
sMsg = ""This is not a Walmart Approved Vendor.""
retVal = oScript.SetError(sMsg)
End If
End if