📚 SAP Business One SDK Help

IsNull Method
See Also  Example

Description

Returns true (Y) if the field is null and false (N) if the field contains a non-null value.

Syntax

Visual Basic
Public Function IsNull() As BoYesNoEnum

Remarks

To get the correct value of "IsNull", it is necessary to call the property Value of SAPbobsCOM.Fields object in order to update the current row of the RecordSet.

Example

C#Copy Code
string Query = "SELECT NULL UNION SELECT 'THIS IS NOT NULL'"; 
 
 
SAPbobsCOM.Recordset recordSet = (SAPbobsCOM.Recordset)SBO_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset); 
recordSet.DoQuery(Query); 
recordSet.MoveFirst(); 
recordSet.MoveNext(); // Skip the first row, goes directly to the row that is NOT NULL 
 
var item = recordSet.Fields.Item("0"); 
var value = item.Value; // This operation updates the current row properties and it is required before using the IsNULL property. 
SAPbobsCOM.BoYesNoEnum isNull = item.IsNull(); // It returns NO. There's a Temporal Coupling behavior for the object SAPbobsCOM.Fields when moving through a RecordSet 
 

See Also