HasRecord - BaseData_Set

Determines if the DataDictionary object (DDO) has a current record

Type: Function

Return Data Type: Boolean

Parameters: None

Return Value

Returns True, if the DDO has a current record.


Syntax
Function HasRecord Returns Boolean

Call: Get HasRecord to BooleanVariable


Description

boolean bHasRecord
Get HasRecord of hoDDO to bHasRecord


HasRecord is used to determine if your DDO has a current record. This can be used to determine if a find operation succeeded (if HasRecord is true), if the DDO buffer did not contain a record prior to the find operation (otherwise, check the Found indicator).

It can also be used to determine if a save will result in a new record save (if HasRecord is false) or an edit of an existing record (if HasRecord is true).

Procedure Refresh integer iMode
    Boolean bHasRecord
    Handle  hoDD

    Forward Send Refresh iMode

    // if record exists, enable the print button.
    Get Server to hoDD
    Get HasRecord of hoDD to bHasRecord
    Set Enabled_State of oPrintBtn to bHasRecord
End_Procedure  // Refresh


If HasRecord is true, the CurrentRowId function will return the value of the RowId. If HasRecord is false, CurrentRowId will contain a null RowId.

Note:
The DDO field buffer may not contain the same record currently loaded in your global file buffer. When working with DDOs you should always refer to the DDO methods HasRecord and CurrentRowId and not use the actual table's status. A file buffer may be synchronized with a DDO by sending the Refind_Records message to the DDO.


Note:
If the DDO buffer already contains a record prior to attempting a find, HasRecord may return True even though the find was unsuccessful, due to the record already in the DDO buffer. In this case, use the Found indicator to check if a find was successful.

See Also

CurrentRowId