Skip to Content

Fastest Way To Add Data Through DI

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 04, 2005 at 04:49 PM

    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

    oMatrix.FlushToDataSource()

       
     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
                                SBO_Application.MessageBox(ret)
                            End If
                        Next i
                    
    

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.