Quantcast
Viewing all articles
Browse latest Browse all 37010

Forum Post: Price Level display script not working

Hey everyone, I'm attempting to write a script, but am running into trouble. I'm using a template from a previous script that I am told was working in the past, but when I copy the same code into my script, it's not working. Can anyone look at this and let me know if they can see the problem? Thank you for all of your comments in advance! My problem comes when they come across the 'return'. in the following comment: if PriceCode<>"MSRP" then retval = oSession.AsObject(oSession.UI).Messagebox( "","PriceCode Function Failed") return Here is the entire script below: If oSession.CompanyCode = "TT2" Then ItemCode = "" PriceCode = "" PriceCodeRecord = "" CustomerPriceLevel = "" DiscountMarkup1 = 0 StandardUnitPrice = 0 udf_adv_wd = 0 udf_container_direct = 0 udf_distributor = 0 udf_12_plus = 0 '******* Check for Price Code MSRP in Item ******* retval =oBusObj.GetValue("ItemCode$",ItemCode) retval =oBusObj.GetValue("PriceCode$",PriceCode) if PriceCode<>"MSRP" then retval = oSession.AsObject(oSession.UI).Messagebox( "","PriceCode Function Failed") return else end if '******* Check for Standard Price Greater than 0 in Item ******* retval =oBusObj.GetValue("StandardUnitPrice$",StandardUnitPrice) if StandardUnitPrice = 0 then retval = oSession.AsObject(oSession.UI).Messagebox( "","StandardUnitPrice Function Failed") return else end if '******* Check to see if UDF's are Populated Already ******* retval =oBusObj.GetValue("UDF_ADV_WD",UDF_Adv_WD) retval =oBusObj.GetValue("UDF_CHAIN_STORES",UDF_ChainStores) retval =oBusObj.GetValue("UDF_CONTAINER_DIRECT",UDF_Container_Direct) retval =oBusObj.GetValue("UDF_DISTRIBUTOR",UDF_Distributor) retval =oBusObj.GetValue("UDF_12_PLUS",UDF_12_Plus) if UDF_Adv_WD <> 0 then retval = oSession.AsObject(oSession.UI).Messagebox( "","UDF_Adv_WD Function Failed") return else end if '******* Get the PriceLevel Object ******* oPriceLevel = oSession.GetObject("IM_PriceCode_bus") '******* Read Price Level A and Get Value ******* PriceCodeRecord = "0" CustomerPriceLevel = "A" retval = oPriceLevel.SetKeyValue("PriceCodeRecord$",PricecodeRecord) retval = oPriceLevel.SetKeyValue("PriceCode$",PriceCode) retval = oPriceLevel.SetKeyValue("CustomerPriceLevel$",CustomerPriceLevel) retval = oPriceLevel.SetKey() '***** Get Discount Markup 1 and add 1 ******* retval = oPriceLevel.GetRecord("DiscountMarkup1",DiscountMarkup1) DiscountMarkup1 = DiscountMarkup1 + 1 AdvWD = StandardUnitPrice*DiscountMarkup retval = oSetValue("UDF_ADV_WD$",AdvWD) '******* Drop Objects ******* retval = oSession.DropObject("IM_PriceCode_bus") End if

Viewing all articles
Browse latest Browse all 37010

Trending Articles



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