Quantcast
Viewing all articles
Browse latest Browse all 37030

Forum Post: RE: Prevent user to order Item for unauthorized vendors

here is the script... It is Column (itemcode) Post validate because we need to make sure the item is a ItemType "1" ... ItemCode = "" itemtype = "" LineKey="" oCIItem = 0 CIVendorNo = "" POVendorNo = "" APDivisionNo = "" Vendor = "" InvApprov = "" retVal = 0 sCompany = "" sCompany = oSession.CompanyCode if sCompany = "TST" then strMSG = "I am in" retVal = oSession.AsObject(oSession.UI).MessageBox("",strMsg) retval = oBusObj.GetValue("LineKey$", LineKey) retVal = oBusObj.GetValue("ItemType$", itemtype) retVal = oBusObj.GetValue("ItemCode$", ItemCode) if itemtype = "1" and LineKey "" then strMSG = "Item Type: " & itemtype & " " & ItemCode retVal = oSession.AsObject(oSession.UI).MessageBox("",strMsg) retVal = oHeaderObj.GetValue("APDivisionNo$", APDivisionNo) strMsg = "AP Division Return Code: " & retVal & " AP Division No: " & APDivisionNo retVal = oSession.AsObject(oSession.UI).MessageBox("",strMsg) retVal = oHeaderObj.GetValue("VendorNo$", POVendorNo) strMsg = "AP Vendor Return Code: " & retVal & " AP Vendor No: " & POVendorNo retVal = oSession.AsObject(oSession.UI).MessageBox("",strMsg) retVal = oHeaderObj.GetValue("UDF_INVAPPROV$", InvApprov) strMsg = "UDF_INVAPPROV Return Code: " & retVal & " UDF_INVAPPROV: " & InvApprov retVal = oSession.AsObject(oSession.UI).MessageBox("",strMsg) if  InvApprov "Y"  then strMsg = " InvApprov is ok ..." retVal = oSession.AsObject(oSession.UI).MessageBox("",strMsg) retVal = oScript.SetError("Vendor is not approved for Inventory Purchases") exit sub strMsg = " SetError retVal ..." & retVal retVal = oSession.AsObject(oSession.UI).MessageBox("",strMsg) end if end if Regards, Manuel Roman

Viewing all articles
Browse latest Browse all 37030

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>