cancel
Showing results for 
Search instead for 
Did you mean: 

Sales Order sorted by item code before add

former_member186712
Active Contributor
0 Kudos

Good morning,

In B1 and in the Sales Order form, I would like sort the item codes in the matrix before the users adds the SO. I would like to get the same behaviuor that when we do a double click in the Item Code header column.

I tried this code but it doesn't work because it also orders the order the "empty line"

Dim Matrix AsMatrix = CType(form.Items.Item("38").Specific, Matrix)

' Get Column object

Dim Column AsColumn = Matrix.Columns.Item("1")

' Ascending sort order

Column.TitleObject.Sort(SAPbouiCOM.BoGridSortType.gst_Ascending)

Example

Line 1 item A005

Line 2 item A002

Line 3 item empty (ready to insert a new item)

When I run this code the matrix becomes

Line 1 item empty

Line 2 item A002

Line 3 Item A005

Any help will be appreciated.

Best regards,

Augusto Silva

Accepted Solutions (1)

Accepted Solutions (1)

pedro_magueija
Active Contributor

Hi Augusto,

Can you delete the first line on the grid after you've ordered it?

Pedro Magueija

LinkedIn | Twitter | Blog

Answers (0)