Sage 2014 My customer would like to know by displaying a message if a Customer has pricing for a specific item during Sales Order entry. Below is my script, but I never seem to find the correct record. I have checked and all my values are filled in correctly for the key, and I saw the part of KCUSTOMER as the key I would need, but I am missing something. cItem = "" cDiv = "" cCust = "" retVal = 0 cCode = "2" oPriceCode="" Prclvl="" retVal = oBusObj.GetValue("ItemCode$",cItem) retval = oBusObj.GetValue("PriceLevel$", Prclvl) retVal = oHeaderObj.GetValue("ARDivisionNo$", cDiv) retVal = oHeaderObj.GetValue("CustomerNo$", cCust) Set oPriceCode = oSession.AsObject(oSession.GetObject("IM_PriceCode_bus")) RetVal = oPriceCode.SetKeyValue("PriceCodeRecord$",cCode) RetVal = oPriceCode.SetKeyValue("PriceCode","") RetVal = oPriceCode.SetKeyValue("ItemCode$",cItem) RetVal = oPriceCode.SetKeyValue("CustomerNo$", cCust) RetVal = oPriceCode.SetKeyValue("ARDivisionNo$", cDiv) RetVal = oPriceCode.SetKeyValue("CustomerPriceLevel$", Prclvl) retvalBrowse = oPriceCode.SetBrowseIndex("KCUSTOMER","") retvalBrowse = oPriceCode.SetBrowseFilter(PriceDiv&PriceCust) RetVal = oPriceCode.Find() If retval = 1 then Set Voice = CreateObject("SAPI.Spvoice") Words = "Customer Pricing" Voice.Speak(Words) else Set Voice = CreateObject("SAPI.Spvoice") Words = "Not Found for Customer" Voice.Speak(Words) End if
↧