cancel
Showing results for 
Search instead for 
Did you mean: 

Removing combobox values.

Former Member
0 Kudos

Hi all,

SBO/SDK: SBO2004 Patch 21.

I have setup a header UDF with one default value on the Sales Order form. I need to be able to add and remove validvalues from this combobox depending on certain scenarios. Adding values is fine but I'm getting an error message when trying to remove them:

Error: -7006

Item - The item is not a user defined item

The code I am using is as follows:

Set oItem = oUDFForm.Items("U_Test")

Set oComboBox = oItem.Specific

Do While oComboBox.ValidValues.Count > 0

oComboBox.ValidValues.Remove 0, psk_Index

Loop

Does anyone have a solution to this or am I doing something wrong? Thanks.

Regards,

Andrew.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Did a bit more testing and the validvalues.remove code above works fine on a non-system form. So why does the SDK allow me to Add values to a combobox on a system form but not remove them?

Regards,

Andrew.

Former Member
0 Kudos

Here a part of the UI help :

<i>Restrictions on System Forms

Form Object

Restricted properties and methods: DataBrowser, SupportedModes, AutoManaged, EnableMenu and ResetMenuStatus

ValidValues Collection

You cannot add or remove values from the collection.</i>

you right, strange that you can add. it seems you should not be allowed to do that.

Former Member
0 Kudos

Hi Sebastien,

I can understand the SDK preventing add/remove from a system dropdown field but not a UDF. Thanks for your response.

Regards,

Andrew.

Answers (0)