on 09-30-2008 6:28 PM
Hi,
I created Add-on Form Using Screen Painter.document type is Master. while Adding Values suddenly i got Error This Entry Already Exist in "My user table Name".Eventhough that entry doesnt exist in my Table. i saw lot of Threads regarding this issue.
but still didnt get any clear suggestion.. i restored my Numbering Files also in utilities. i was not able to move For further Functionalities because of this issue....
Any Suggestion...
Thanks in Advance
Ganesh K
Hi..
After matrix use this code
oForm.DataSources.DBDataSources.Item(1).Clear()
example...
oitem = oForm.Items.Item("38")
oMatrix = oitem.Specific
oForm.DataSources.DBDataSources.Item(1).Clear()
Regards..
Billa 2007
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
go to document numbering in business one.
select your udo
close the old range
create a new range and assign it as default.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Ganesh, this is a common problem with UDO, to overcome this u in the update mode u need to delete all the records in the line table so that the update will go on smoothly.
The following is the code which i follow to avoide this.
In the item event in the before action part i execute the following code
If pVal.FormMode = 2 And pVal.ItemUID = "1" Then 'In UPDATE Mode
strDocNum = objForm.Items.Item("txtCode").Specific.String
objMatrix = objForm.Items.Item("matMand").Specific
objForm.Freeze(True)
UpdateMatrixRowsDel(objForm)
objMatrix.FlushToDataSource()
For Count = 1 To objMatrix.RowCount
'oDataSrc.SetValue("LineId", Count - 1, oDataSrc.GetValue("DocEntry", Count - 1))
Next
objMatrix.LoadFromDataSource()
objForm.Freeze(False)
End If
And now for UpdateMatrixRowsDel this is the code..
Private Sub UpdateMatrixRowsDel(ByVal objForm As SAPbouiCOM.Form)
Dim oUserTable As SAPbobsCOM.UserTable = Nothing
Try
oDataSrc = objForm.DataSources.DBDataSources.Item("@EMR_MAND_DET")
oDataSrc.Clear()
oDataSrc.Query()
objMatrix = objForm.Items.Item("matMand").Specific
objMatrix.FlushToDataSource()
oUserTable = objSBOAPI.oCompany.UserTables.Item("EMR_MAND_DET")
Dim strDocEntry As String = ""
If objMatrix.RowCount > 0 Then
' MsgBox(objMatrix.RowCount)
If oDataSrc.GetValue("U_ItemUID", objMatrix.RowCount - 1) = "" Then
If blnMenuDel = True Then
objMatrix.DeleteRow(objMatrix.RowCount - 1)
Else
objMatrix.DeleteRow(objMatrix.RowCount)
End If
blnMenuDel = False
objMatrix.FlushToDataSource()
End If
Dim i As Integer
i = 1
For Count = 0 To oDataSrc.Size - 1
If oUserTable.GetByKey(oDataSrc.GetValue("Code", Count)) Then
strDocEntry = oDataSrc.GetValue("Code", Count)
End If
Next
oDataSrc.Query()
oDataSrc.Clear()
End If
strSQL = "Delete FROM [@EMR_MAND_DET] WHERE Code = '" & strDocEntry & "'"
objRecSet = objSBOAPI.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
objRecSet.DoQuery(strSQL)
blnFrmUpdate = True
'objMatrix.AddRow()
Catch ex As Exception
Throw ex
Finally
System.Runtime.InteropServices.Marshal.ReleaseComObject(oUserTable)
oUserTable = Nothing
GC.WaitForPendingFinalizers()
GC.Collect()
End Try
End Sub
Hope this helpz u solve it..
Vasu Natari.
create a new document range and set it as the default for the udo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.