cancel
Showing results for 
Search instead for 
Did you mean: 

Invalid valid value BoYesNoEnum while update Item Prices

Former Member
0 Kudos

Hello,

I have a question:

When i'm trying to update an item through the SAPbobsCOM.Item object, i get an error while updating it.

The following actions are executed:


article_prices.UserFields.Fields.Item("U_bPlist").Value = bPlist;
article_prices.UserFields.Fields.Item("U_Toeslag").Value = Convert.ToDouble(toeslag, CultureInfo.InvariantCulture);
article_prices.Currency = "EUR";
article_prices.Price = Convert.ToDouble(newPrice, CultureInfo.InvariantCulture);

if (articles.Update() != 0)
{
          company.GetLastError(out returnCode, out errorMessage);
}

The exact error i'm getting is: Invalid valid value 'B' in Enum 'BoYesNoEnum', the valid values are 'N', 'Y'

But the strange thing is that there isn't any other property i'm trying to set, and definately no property with the value 'B'. And then the other strange thing is that some items are updated, and some are not.

I tried to compare those two items (one who updates, and one who wouldnt) in the database and in SBO, but without results. I'm stunned..

Can anyone tell me what is happening?

Thanks in advance.

Jeroen Nijhuis

Edited by: Jeroen Nijhuis on Aug 29, 2008 9:43 AM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Unless the "B" already exists in the DB row that you are updating, which could cause the error, then it certainly sounds like a DI problem to me.

Former Member
0 Kudos

I already found the B in de table row. It was placed in the ByWh column on the OITM table. On some of our old databases the value was set to "B". I guess this is done by SBO on one of the first patchlevels.

The SDK Documentation shows that the oItem.ManageStockByWareHouse is a BoYesNoEnum field. But the Table reference doesnt show valid values for the ByWh Column on the table.

Anyways, you're describing the problems, so it could be helpful to anyone else having this problems. Just be sure to always check the already set values on the tablerows.