Showing results for 
Search instead for 
Did you mean: 

Fastest Way To Add Data Through DI

Former Member
0 Kudos

For Examples there're 5 or more rows in Matrix when i press add button it takes too long time about 10 seconds more. i dont know whether there's faster way. i did matrix row looping from row 1 to Matrix.rowcount to do oDocument_Lines.add .After all data add i do oDocument.add.

I know that many developers complaint about the DI Performance, but is there any way to enhance DI performance ? Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Hamdi,

There is a work around, If you bind the Matrix to a user defined table (It can be a blank table), and then use the oMatrix.LoadFromDatasource and oMatrix.FlushtoDatasource, you can manipulate/collect/call the data using the dbdatasource object.

This is quite fast, and I have had no problem with it, and also using a Documents object to do a goods receipt.

To recap, bound dbdatasource (blank if needed) to a usertable, use flushtodatasource and LoadFromDatasource and use dbdatasource.offset method

I attach some sample Code.

Populate your Matrix


 For i = 0 To Scanindb.Size - 1
                        If Trim(Scanindb.GetValue(4, i)) = "No" Then
                            ' Right we need to add the item
                            OITMOBject.ItemCode = Trim(Scanindb.GetValue(0, i))
                            OITMOBject.Manufacturer = "-1"
                            OITMOBject.ItemsGroupCode = "101"
                            OITMOBject.UserFields.Fields.Item(4).Value = Scanindb.GetValue(3, i)
                            OITMOBject.UserFields.Fields.Item(5).Value = Scanindb.GetValue(2, i)
                            ret = OITMOBject.Add
                        End If
                    Next i

Answers (0)