Record.GetPosition([Boolean]) Method
Version: Available or changed with runtime version 1.0.
Gets a string that contains the primary key of the current record.
Syntax
String := Record.GetPosition([UseNames: Boolean])
Parameters
Record
Type: Record
An instance of the Record data type.
[Optional] UseNames
Type: Boolean
Indicates whether a reference to the field caption or the field number should be returned. If set to true (default value) or empty, then the returned string contains references to field captions in the table with which the record is associated. If a field doesn't have a caption, then the name is returned. If the parameter is set to false, then field numbers are used instead.
Return Value
String
Type: Text
Example
The following example uses the GetPosition method to retrieve the primary key of the current record (MyRecord) from the Customer table. The primary key is stored in the varPrimaryKey variable and displayed in a message box. The UseNames parameter is set to true so the caption of the field that contains the primary key is returned. If you set UseNames to false, the number of the field is returned.
var
MyRecord: Record Customer;
varPrimaryKey: Text;
Text000: Label 'The primary key is: %1.';
begin
varPrimaryKey := MyRecord.GetPosition(true);
Message(Text000, varPrimaryKey);
end;
See Also
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈