Уреди

Делите путем


RecordRef.Number() Method

Version: Available or changed with runtime version 1.0.

Gets the table ID (number) of the table that contains the record that was referred to by the RecordRef.

Syntax

No :=   RecordRef.Number()

Note

This method can be invoked using property access syntax.

Parameters

RecordRef
 Type: RecordRef
An instance of the RecordRef data type.

Return Value

No
 Type: Integer
The table ID of the table that contains the record that was referred to by the RecordRef.

Remarks

In versions of Dynamics 365 earlier than Microsoft Dynamics NAV 2013, if a RecordRef referred to a temporary table, then the table number value of the RecordRef was the run-time generated sequence ID, which is from the base value of 2000100000. You could use the table number to determine whether a RecordRef referred to a temporary table. In Dynamics 365 Business Central, the table number value of a RecordRef always contains the ID of the originating physical table and not the run-time generated sequence ID. If you previously used the Number Method (RecordRef) to test for the sequence number and determine whether the RecordRef was temporary, then you must use the IsTemporary Method (RecordRef) in Dynamics 365 instead.

Example

The following example opens the Customer table (18) as a RecordRef object. The Open Method (RecordRef) accepts Database::Customer as an integer. The Number method retrieves the table number and displays the name and number of the table in a message box.

var
    MyRecordRef: RecordRef;
    varDatabaseName: Integer;
    varTableNumber: Integer;
    Text000: Label '%1 is table %2.'; 
begin   
    varDatabaseName := Database::Customer;  
    MyRecordRef.Open(varDatabaseName);  
    varTableNumber := MyRecordRef.Number;  
    Message(Text000, MyRecordRef.Caption, varTableNumber);  
end;
  

RecordRef Data Type
Get Started with AL
Developing Extensions