cancel
Showing results for 
Search instead for 
Did you mean: 

Set ItemCode on Order

Former Member
0 Kudos
118

Hi,

I am working in the sales order form (type 139).

I try to fill the order screen by code (with UI).

So I try to set a value in the ItemCode field per setting the string property of the columns-cell-specific.

itemcode = <some existing itemcode (i check on existance)>
Idx = 1
oEdit = oMArtikel.Columns.Item("1").Cells.Item(Idx).Specific
oEdit.String = itemcode

On the last line an error occur:

System.Runtime.InteropServices.COMException - Form - Invalid Form Item

Is this a restricted action or am I doing something wrong?

Greetz

Eddy

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Eddy,

I suppose the oMArtikel is a matrix object, and oEdit is an EditText.

Looks like the EditText you are trying to edit doesn´t exist. Could be that the ID´s are not rigth.

Regards,

Ibai Peña

PS: How did you create the form and matrix?

Former Member
0 Kudos

Hi Eddy,

I suppose the oMArtikel is a matrix object, and oEdit

is an EditText.

Looks like the EditText you are trying to edit

doesn´t exist. Could be that the ID´s are not rigth.

Regards,

Ibai Peña

Hi Ibai,

Thanks for your help. But I can get the string property, but I couldn't set it. The indexes are right and the EditText exists.

But I must set the cardcode first. When I do my code after I set the cardcode, no error occur.

So this is solved, thank you very much.

Eddy

Former Member
0 Kudos

Hi Eddy,

Of course you should set the Cardcode before the ItemCodes. Remember to do the coding exactly as you would do it manually in SBO GUI. Will help to avoid lot of errors.

Regards,

Ibai Peñ