Distinguishing between `BoRecordset` and `BoRecordsetEx` within the SAP Business One SDK framework reveals key disparities in functionality and utility
1. BoRecordset:
The blog primarily focuses on topics related to SAP Business One, providing detailed information about technical aspects such as types of hyperlinks on page objects, linked analysis in SAP Lumira, and drill paths in SAP Lumira. The content seems to be structured and oriented towards providing in-depth knowledge about the technical features and functionalities of SAP Business One.
1. BoRecordset:
Public Sub SetExchangeRate(ByVal strSourceCurr As String, ByVal oDate As Date, ByVal dblValue As Double)
Dim vObj As SAPbobsCOM.SBObob
oApp = New ClsSAPConn
vObj = oApp.SAPCompany.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoBridge)
Try
vObj.SetCurrencyRate(strSourceCurr, oDate, dblValue, True)
Catch ex As Exception
Finally
If vObj IsNot Nothing Then
vObj = Nothing
End If
End Try
End Sub
Public Function ConvertDateStringToDate(ByVal strDateValue As String) As DateTime
Dim vObj As SAPbobsCOM.SBObob = Nothing
Dim retDate As DateTime
vObj = oApplication.SAPCompany.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoBridge)
Try
retDate = Convert.ToDateTime(vObj.Format_StringToDate(strDateValue).Fields.Item(0).Value)
Catch ex As Exception
retDate = Nothing
Finally
If vObj IsNot Nothing Then
vObj = Nothing
End If
End Try
Return retDate
End Function
Public Sub FillComboBoxValue(ByVal oApp As Object, ByVal aForm As SAPbouiCOM.Form, ByVal aComUId As Object, ByVal strQuery As String, ByVal blnDefNew As Boolean)
'********************************************
'' DECLARE LOCAL VARIABLES'
'********************************************
Dim aCombo As SAPbouiCOM.ComboBox = Nothing
Dim oRS As SAPbobsCOM.Recordset = Nothing
'********************************************
oApp = New ClsSAPConn
'********************************************
oRS = oApp.SAPCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
aCombo = aForm.Items.Item(aComUId).Specific
'******************************************
Try
oRS.DoQuery(strQuery)
'' To Avoid Valid Value Issue
If aCombo.ValidValues.Count > 0 Then
For i As Integer = 1 To aCombo.ValidValues.Count
aCombo.ValidValues.Remove(0, SAPbouiCOM.BoSearchKey.psk_Index)
Next
End If
If oRS.RecordCount > 0 Then
While Not oRS.EoF
aCombo.ValidValues.Add(oRS.Fields.Item(0).Value, oRS.Fields.Item(1).Value)
oRS.MoveNext()
End While
End If
Select Case blnDefNew
Case True
aCombo.ValidValues.Add("-9", "DEFINE NEW")
Case False
aCombo.ValidValues.Add("", "")
End Select
aCombo.Item.DisplayDesc = True
Catch ex As Exception
Finally
If aCombo IsNot Nothing Then
aCombo = Nothing
End If
If oApp IsNot Nothing Then
oApp = Nothing
End If
End Try
End Sub
Public Sub SetCurrentDate(ByVal aForm As SAPbouiCOM.Form, ByVal strEditText As String)
Dim oEditText As SAPbouiCOM.EditText = Nothing
oEditText = aForm.Items.Item(strEditText).Specific
Try
oEditText.Value = DateTime.Now.ToString("yyyyMMdd")
Catch ex As Exception
Finally
If oEditText IsNot Nothing Then
oEditText = Nothing
End If
End Try
End Sub
Public Function GetComboBoxSelectedValue(ByVal oForm As SAPbouiCOM.Form, ByVal oComUID As String) As Object
'*****************************************
'DECLARE LOCAL VARIABLE(S)
'*****************************************
Dim oComboBox As SAPbouiCOM.ComboBox = Nothing
'*****************************************
oComboBox = oForm.Items.Item(oComUID).Specific
Try
Return oComboBox.Value.Trim()
Catch ex As Exception
Return Nothing
Finally
End Try
End Function
Public Sub DisplayAutoSelValue(ByVal oApp As Object, ByVal aForm As SAPbouiCOM.Form, ByVal aComUId As Object, ByVal intIndex As Integer)
'********************************************
'' DECLARE LOCAL VARIABLES'
'********************************************
Dim aCombo As SAPbouiCOM.ComboBox = Nothing
Dim oRS As SAPbobsCOM.Recordset = Nothing
'********************************************
oApp = New ClsSAPConn
'********************************************
oRS = oApp.SAPCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
aCombo = aForm.Items.Item(aComUId).Specific
'********************************************
Try
aCombo.Select(intIndex, SAPbouiCOM.BoSearchKey.psk_Index)
Catch ex As Exception
Finally
If aCombo IsNot Nothing Then
aCombo = Nothing
End If
If oApp IsNot Nothing Then
oApp = Nothing
End If
End Try
End Sub
Friend Sub AddButton(ByVal objForm As SAPbouiCOM.Form, ByVal SourceID As String, ByVal ItemUID As String, ByVal iLeft As Integer, ByVal iWidth As Integer, ByVal LinkTo As String, ByVal Caption As String, ByVal iHeight As Integer)
Try
Dim oItem As SAPbouiCOM.Item
If objForm IsNot Nothing Then
oItem = objForm.Items.Add(ItemUID, SAPbouiCOM.BoFormItemTypes.it_BUTTON)
oItem.Top = objForm.Items.Item(SourceID).Top
oItem.Left = iLeft + (objForm.Items.Item(SourceID).Left + objForm.Items.Item(SourceID).Width)
oItem.Width = iWidth
oItem.Height = iHeight
oItem.LinkTo = LinkTo
Dim btn As SAPbouiCOM.Button = objForm.Items.Item(ItemUID).Specific '' To Assign New Button
btn.Caption = Caption
End If
Catch ex As Exception
Finally
End Try
End Sub
Public Function GetComboBoxSelectedValue(ByVal oMatrix As SAPbouiCOM.Matrix, ByVal intRowIndex As Integer, ByVal intColIndex As Integer) As Integer
Dim oComBo As SAPbouiCOM.ComboBox = oMatrix.Columns.Item(intColIndex).Cells.Item(intRowIndex).Specific
Return oComBo.Value.Trim()
End Function
select 51119 + row_number() over (order by tableid), tableid
from
(
select distinct
tableID from cufd
where tableid like N'@%'
and tableid not in
(
select '@' + tablename from oudo
)
and tableid not in
(
select '@' + tablename from udo1
)
) t
order by tableID
Public Sub OpenFormThroughMenuId(ByVal SBO_Application As SAPbouiCOM.Application, ByVal oActMenu As String)
SBO_Application.ActivateMenuItem(oActMenu)
End Sub
Public Sub BindDate(ByVal oForm As SAPbouiCOM.Form, ByVal oDsName As Object, ByVal dbAlias As Object)
Dim oDBDataSource As SAPbouiCOM.DBDataSource = Nothing
oDBDataSource = oForm.DataSources.DBDataSources.Item(oDsName)
Try
With oDBDataSource
.SetValue(dbAlias, 0, DateTime.Today.ToString("yyyyMMdd"))
End With
Catch ex As Exception
End Try
End Sub
Public Sub AssignCFLToEditText(ByVal aForm As SAPbouiCOM.Form, ByVal strEditUid As String, ByVal strCFLId As String, ByVal strCFLAliase As String)
Dim oItem As SAPbouiCOM.Item = Nothing
Dim oEdit As SAPbouiCOM.EditText = Nothing
Try
oItem = aForm.Items.Item(strEditUid)
oEdit = oItem.Specific
oEdit.ChooseFromListUID = strCFLId
oEdit.ChooseFromListAlias = strCFLAliase
Catch ex As Exception
Finally
If oItem IsNot Nothing Then
oItem = Nothing
End If
If oEdit IsNot Nothing Then
oEdit = Nothing
End If
End Try
End Sub
oApplication.SAPCompany.UserSignature
oApplication.SAPCompany.UserName.Trim
Imports System.Drawings
oGrid.Column.Item("ColName").Backcolor = ColorTranslator.ToOle(Color.White)