The AL developer preview is still evolving with frequent updates. Follow us on the Dynamics NAV Team Blog for the announcements.
NUMBER Method (RecordRef)
Gets the table ID (number) of the table that contains the record that was referred to by the RecordRef.
No := RecordRef.NUMBER
The RecordRef that refers to the table in which you are interested.
Property Value/Return Value
The number of the table or the number of the field.
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 for Finance and Operations, Business edition, 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.
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. This example requires that you create the following variables global text constant.
|Text constant name||DataType||ENU value|
|Text000||Text||%1 is table %2.|
varDatabaseName := DATABASE::Customer; MyRecordRef.OPEN(varDatabaseName); varTableNumber := MyRecordRef.NUMBER; MESSAGE(Text000, MyRecordRef.CAPTION, varTableNumber);