on 09-03-2008 8:43 AM
Hi, we are migrating from 2005A PL39 to 2007A PL30 and i find an old problem that was resolved in 2005A, when i delete the last and unique row of a matrix in a UDO form it doesn´t modified database and the row persits.
Does any one have the same problem?
Thanks,
Daniel
Thanks Mohama for your answer, I tried your sample but i doesn´t work for me in version 2007 (in version 2005 runs well).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Daniel,
I'm working with B1 2007A, and I remove a row with this function
Private Sub DeleteLine(ByRef oCompany As SAPbobsCOM.Company, ByRef oApplication As SAPbouiCOM.Application, _
ByRef pVal As SAPbouiCOM.MenuEvent)
oForm = oApplication.Forms.ActiveForm
Try
oForm.Freeze(True)
If oForm.Mode <> BoFormMode.fm_FIND_MODE Then
Dim oMatrix As SAPbouiCOM.Matrix = oForm.Items.Item("mtx_NP").Specific
Dim LineDeleted As Boolean = False
With oForm.DataSources.DBDataSources.Item("@ADAT_NP1")
For i As Integer = 1 To .Size - 1
If oMatrix.Columns.Item("V_LineId").Cells.Item(i).Specific.Value <> i Then
If LineDeleted = True Then
If oForm.Mode = BoFormMode.fm_ADD_MODE Then .SetValue("LineID", i - 1, CStr(i))
Else
.RemoveRecord(i - 1)
If oForm.Mode = BoFormMode.fm_ADD_MODE Then .SetValue("LineID", i - 1, CStr(i))
LineDeleted = True
End If
End If
Next
End With
oMatrix.LoadFromDataSource()
End If
Catch ex As Exception
oApplication.MessageBox("DeleteLine(): " & ex.Message)
Finally
oForm.Freeze(False)
End Try
Hope it helps,
Vítor Vieira
hi..
try this one
If (pVal.MenuUID = "OnlyOnRC") And (pVal.BeforeAction = False) Then
Try
Dim oMenuItem As SAPbouiCOM.MenuItem
Dim oMenus As SAPbouiCOM.Menus
Dim omat As SAPbouiCOM.Matrix
Dim GCols As SAPbouiCOM.Columns
Dim i As Integer
oitem = OForm.Items.Item("38")
omat = oitem.Specific
GCols = omat.Columns
omat = OForm.Items.Item(selItem).Specific
For i = 1 To omat.RowCount
If omat.IsRowSelected(i) = True Then
omat.DeleteRow(i)
Exit For
End If
Next
Catch ex As Exception
SBO_Application.MessageBox(ex.Message)
End Try
End If
regards...
Mohana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.