RecordRef.FieldCount() Method
Version: Available or changed with runtime version 1.0.
Gets the number of fields in the table that is currently selected or returns the number of fields that have been defined in a key. Returns an error if no table or no key is selected.
Syntax
Count := RecordRef.FieldCount()
Note
This method can be invoked using property access syntax.
Parameters
RecordRef
Type: RecordRef
An instance of the RecordRef data type.
Return Value
Count
Type: Integer
The number of fields in the table.
Example
The following example loops through tables 3 through 5 and displays the number of fields that are defined in each table. The code starts by opening table 3 (Payment Terms) as a RecordRef variable that is named MyRecordRef. MyRecordRef variable uses the FieldCount method to retrieve the number of fields that are defined in the table and stores it in the varFieldCount variable. The name of each table and the total number of fields in the table are displayed in a message box. The table that is open is closed before the next one is open.
var
MyRecordRef: RecordRef;
varFieldCount: Integer;
Text000: Label 'The %1 table contains %2 field\(s\).\\';
begin
for i := 3 to 5 do begin
MyRecordRef.Open(i);
varFieldCount := MyRecordRef.FieldCount;
Message(Text000, MyRecordRef.Name, varFieldCount);
MyRecordRef.Close;
end;
end;
See Also
RecordRef Data Type
Get Started with AL
Developing Extensions
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈