BOI for Volume Pricing Check

Hello All,

I'm using the code below to determine whether volume pricing exists for an item, but I'm getting a retval of 0 when I know there is pricing configured.  My code and the record from Data File Display and Maintenance are below.  Also, I have confirmed that my "ItemNo" variable contains the correct item code.  Can you spot my error?  Thanks!

'code

retVal = oPriceCode.SetKeyValue("PriceCodeRecord$","1") 
retVal = oPriceCode.SetKeyValue("PriceCode$"," ")
retVal = oPriceCode.SetKeyValue("ItemCode$",ItemNo)
retVal = oPriceCode.SetKeyValue("CustomerPriceLevel$"," ")
retVal = oPriceCode.SetKeyValue("ARDivisionNo$"," ")
retVal = oPriceCode.SetKeyValue("CustomerNo$", " ")
retVal = oPriceCode.SetKey()

DFDM:

01 PriceCodeRecord$..... [1]
02 PriceCode$........... []
03 ItemCode$............ [0001]
04 CustomerPriceLevel$.. []
05 ARDivisionNo$........ []
06 CustomerNo$.......... []
07 PriceCodeDesc$....... []
08 PricingMethod$....... Time
09 BreakQuantity1....... 99,999,999.00
10 BreakQuantity2....... .00
11 BreakQuantity3....... .00
12 BreakQuantity4....... .00
13 BreakQuantity5....... .00
14 DiscountMarkup1...... 10.00
15 DiscountMarkup2...... .00
16 DiscountMarkup3...... .00
17 DiscountMarkup4...... .00
18 DiscountMarkup5...... .00

  • 0

    1. oPriceCode is "IM_PriceCode_Bus"?

    2. For the fields that don't have values like PriceCode$, there shouldn't be space between the quote marks.  (I can't really tell from looking at your code).

    3.  You can try just setting the the key fields with values.

    retVal = oPriceCode.SetKeyValue("PriceCodeRecord$", "1")

    retVal = oPriceCode.SetKeyValue("ItemCode$", ItemNo)

    retVal = oPriceCode.SetKey()

  • 0 in reply to Natasha Chang

    Thanks for your post.  Apparently I needed to do a .movefirst because I had previously used oPriceCode to get customer price level info within my script.  Final script snippet is below, in case you have further advice for me.  Thanks!

    'START - Check for volume pricing for this item

    oPriceCode.MoveFirst()

    retValVolPrice = oPriceCode.SetKeyValue("PriceCodeRecord$","1")    '1=Item Pricing 2 = customer pricing

    retValVolPrice = oPriceCode.SetKeyValue("PriceCode$","")

    retValVolPrice = oPriceCode.SetKeyValue("ItemCode$",ItemNo)

    retValVolPrice = oPriceCode.SetKeyValue("CustomerPriceLevel$","")

    retValVolPrice = oPriceCode.SetKeyValue("ARDivisionNo$","")

    retValVolPrice = oPriceCode.SetKeyValue("CustomerNo$", "")

    retValVolPrice = oPriceCode.SetKey()