Welcome Notes

Welcome Viewers

29 February 2024

Distinguishing between `BoRecordset` and `BoRecordsetEx` within the SAP Business One SDK

 Distinguishing between `BoRecordset` and `BoRecordsetEx` within the SAP Business One SDK framework reveals key disparities in functionality and utility


1. BoRecordset:

  1.  Serves as a fundamental recordset within the SAP Business One SDK.
  2.  Primary function: Facilitates querying and retrieval of data from database tables.
  3.  Key Features:
  4.  Executes SQL queries against the database.
  5.  Retrieves data row by row.
  6.  Offers simplicity and directness.
  7.  Ideal for standard scenarios.
  8.  Illustrative Usage:

C#.Net
var oRecordSet = (SAPbobsCOM.Recordset)company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
oRecordSet.DoQuery(SELECT TOP 1 T0.[DocID] FROM [dbo].[@Testtable] T0 ORDER BY T0.[DocID] DESC);
VB.Net
Dim oRecordSet = CType(company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset), SAPbobsCOM.Recordset)
oRecordSet.DoQuery(SELECT TOP 1 T0.[DocID] FROM [dbo].[@Testtable] T0 ORDER BY T0.[DocID] DESC)

 2. BoRecordsetEx:

  •     Represents an enhanced version of the recordset.
  •       Core objective: Offers advanced features and functionalities beyond the basic recordset.
  •       Key Features:
  •       Supports intricate queries and operations.
  •       Enables handling of multiple result sets.
  •       Provides enhanced control over data retrieval.
  •       Ideal for complex scenarios.
  •       Illustrative Usage (simplified):  
C#.NET
var oRecordSetEx = (SAPbobsCOM.Recordset)company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordsetEx);
oRecordSetEx.DoQuery(SELECT CardCode, CardName FROM OCRD WHERE CardType = C);
 while (!oRecordSetEx.EoF)
 {
 // Process each record...
 oRecordSetEx.MoveNext();
 }
 VB.Net
 Dim oRecordSetEx = CType(company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordsetEx), SAPbobsCOM.Recordset)
 oRecordSetEx.DoQuery("SELECT CardCode, CardName FROM OCRD WHERE CardType = 'C'")
 While Not oRecordSetEx.EoF
 oRecordSetEx.MoveNext()
 End While

#SAPBusinessOne #BoRecordset #BoRecordsetEx #SDKframework #SAPdevelopment #SAPprogramming #SAPtips #SAPdeveloper #SAPcommunity #techquestions