on ‎2014 Sep 30 10:41 AM
Hi,
I need docentry when i post the document through UI API.
Request clarification before answering.
Hi Nandappa,
The form object contains the DBDataSource which contains the fields (including the DocEntry). This only works when the document has already been created (form in OK mode). E.g.: form.DataSources.DBDataSources.Item("OINV").GetValue("DocEntry", 0);
If you are creating the document, then you need to capture the "after" FormDataAdd event and prompt for the last created key (Company.GetNewObjectKey();).
Best regards,
Pedro Magueija
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Private Sub SBO_Application_FormDataEvent(ByRef BusinessObjectInfo As SAPbouiCOM.BusinessObjectInfo, ByRef BubbleEvent As Boolean) Handles SBO_Application.FormDataEvent
Try
Select Case BusinessObjectInfo.FormTypeEx
Case "139"
Select Case BusinessObjectInfo.EventType
Case SAPbouiCOM.BoEventTypes.et_FORM_DATA_UPDATE
'If BusinessObjectInfo.BeforeAction = False Then
' oForm = SBO_Application.Forms.ActiveForm
' oForm.Items.Item("tab_RData").Visible = False
'ElseIf BusinessObjectInfo.BeforeAction = False And BusinessObjectInfo.ActionSuccess = True Then
'End If
'Case SAPbouiCOM.BoEventTypes.et_FORM_DATA_ADD
' oForm = SBO_Application.Forms.ActiveForm
' oForm.Items.Item("tab_RData").Visible = False
Case SAPbouiCOM.BoEventTypes.et_FORM_DATA_LOAD
If BusinessObjectInfo.BeforeAction = False Then
docentry = oForm.DataSources.DBDataSources.Item(0).GetValue("DocEntry", 0) ' Convert.ToInt32(oForm.DataSources.DBDataSources.Item(0).GetValue("DocEntry", 0))
Call FRDCheck(docentry, oForm.TypeEx)
End If
Case SAPbouiCOM.BoEventTypes.et_FORM_DATA_ADD And BusinessObjectInfo.ActionSuccess = True
oForm = SBO_Application.Forms.Item(BusinessObjectInfo.FormUID)
Dim soDocEntry As String
Dim odbds As SAPbouiCOM.DBDataSource = CType(oForm.DataSources.DBDataSources.Item(0), SAPbouiCOM.DBDataSource)
Dim oSaleOrder As SAPbobsCOM.Documents
oSaleOrder = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)
soDocEntry = odbds.GetValue("DocEntry", odbds.Offset).Trim
End Select
End Select
Catch ex As Exception
SBO_Application.StatusBar.SetText(ex.Message, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
BubbleEvent = False
Exit Sub
End Try
End Sub
| User | Count |
|---|---|
| 57 | |
| 29 | |
| 21 | |
| 11 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.