Skip to Content
0
Former Member
May 11, 2009 at 01:31 PM

Fill matrix (child table of UDO)

16 Views

hi,

how can i fill the matrix in my form, which is bind to a child table of my UDO?

I'm using an UDO of type master data. i have 1 child table (omatrixtemp), which should be filled automatically, by another matrix. The matrix will be filled, but after i pressed update on my form the following error is thrown:

"This entry exists already in the following tables..."

Here is my code:

For iRow = 1 To oMatrix.VisualRowCount
                dWeight = oMatrix.Columns.Item("dweight").Cells.Item(iRow).Specific.string()
                If dWeight > 0 Then
                    oForm.DataSources.UserDataSources.Item("DSscalval").Value = "Ja"
                    dAmount = oMatrix.Columns.Item("damount").Cells.Item(iRow).Specific.string()
                    dPercent = oMatrix.Columns.Item("dpercent").Cells.Item(iRow).Specific.string()
                    oDS.InsertRecord(oDS.Size - 1)
                    oDS.SetValue("U_icondid", oDS.Size - 1, "" & iCondid)
                    oDS.SetValue("U_dweight", oDS.Size - 1, dWeight)
                    oDS.SetValue("U_damount", oDS.Size - 1, dAmount)
                    oDS.SetValue("U_dpercent", oDS.Size - 1, dPercent)
                End If
            Next iRow

            oMatrixTemp.Clear()
            oMatrixTemp.LoadFromDataSource()

Does anybody know how to fill the matrix of an udo?

thanks Markus