on 10-08-2010 11:52 AM
Hi
I'm using the DI to add Special Prices for certain BPs. I'm either adding or updating records depending on whether the BP/ItemCode combinations are already set up as Special Prices or not.
I've set it so the price list to use is always -2(Without Price List), but I'm having a bit of a problem when trying to add items. The Special Price doesn't add and I get the error "-10 No price defined for item in selected price list".
I've tried doing the same thing using the user interface and it allows me to add the Special Price. The strange thing is though if I try updating a Special Price through the DI after adding it through the UI it works even though the update code is exactly the same as the add code however instead of using .Add to add a new record I'm using .Update.
Does anyone know what could be causing this.
Thanks
Steve
Dear Steven,
First you must set your line setCurrentLine() for adding a new price.
see this thread:
else from the sdk help:
'Call the object
Dim vSP As SAPbobsCOM.SpecialPrices
Set vSP = vCompany.GetBusinessObject(oSpecialPrices)
'set object's properties
vSP.CardCode = "D10002"
vSP.Currency = "Eur"
vSP.DiscountPercent = 30.3
vSP.ItemCode = "A00001"
vSP.Price = 355.3
vSP.PriceListNum = 0
'Call the Add method
Call vSP.Add
or
Dim oSpp As SAPbobsCOM.SpecialPrices
oSpp = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oSpecialPrices)
oSpp.PriceListNum = 4
oSpp.ItemCode = "I0001"
oSpp.Price = 33.033
oSpp.SpecialPricesDataAreas.PriceListNo = 4
oSpp.SpecialPricesDataAreas.DateFrom = #10/20/2007 12:14:00 PM#
oSpp.SpecialPricesDataAreas.Dateto = #11/20/2007 12:14:00 PM#
oSpp.SpecialPricesDataAreas.Discount = 5
oSpp.SpecialPricesDataAreas.Add()
oSpp.SpecialPricesDataAreas.PriceListNo = 4
oSpp.SpecialPricesDataAreas.DateFrom = #11/21/2007 12:14:00 PM#
oSpp.SpecialPricesDataAreas.Dateto = #11/30/2007 12:14:00 PM#
oSpp.SpecialPricesDataAreas.Discount = 6
oSpp.SpecialPricesDataAreas.Add()
oSpp.SpecialPricesDataAreas.PriceListNo = 4
oSpp.SpecialPricesDataAreas.DateFrom = #12/21/2008 12:14:00 PM#
oSpp.SpecialPricesDataAreas.Dateto = #12/30/2008 12:14:00 PM#
oSpp.SpecialPricesDataAreas.SpecialPrice = 28.808
oSpp.SpecialPricesDataAreas.SpecialPricesQuantityAreas.Quantity = 101
oSpp.SpecialPricesDataAreas.SpecialPricesQuantityAreas.SpecialPrice = 25.012
oSpp.SpecialPricesDataAreas.SpecialPricesQuantityAreas.Add()
oSpp.SpecialPricesDataAreas.SpecialPricesQuantityAreas.Quantity = 401
oSpp.SpecialPricesDataAreas.SpecialPricesQuantityAreas.SpecialPrice = 24.98
Dim retV As Integer = oSpp.Add()
Else post your own code or take a look in the SDK help
HTH Regards Teun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Cheers I've sorted it now it was because I wasn't choosing the correct Price List. Without Price List is 0 not -2.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
110 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.