FieldRef.OptionCaption() Method
Version: Available or changed with runtime version 1.0.
Gets the option caption of the field that is currently selected.
Syntax
OptionCaption := FieldRef.OptionCaption()
Note
This method can be invoked using property access syntax.
Parameters
FieldRef
Type: FieldRef
An instance of the FieldRef data type.
Return Value
OptionCaption
Type: Text
Remarks
The option caption of the field is returned as a comma-separated string.
If the field is not an Option, an empty string is returned.
This method returns an error if no field is selected.
Example
The following example opens the Item table as a RecordRef variable that is named ItemRecref. and creates a reference to field 19 (Price/Profit Calculation field), which is an Option field. The OptionCaption method retrieves the caption of the option field and displays the options as a comma-separated list.
var
MyFieldRef: FieldRef;
ItemRecref: RecordRef;
OptionCaption: Text;
begin
ItemRecref.Open(Database::Item);
MyFieldRef := ItemRecref.Field(19);
OptionCaption := MyFieldRef.OptionCaption;
Message('%1', OptionCaption);
end;
See Also
FieldRef Data Type
Get Started with AL
Developing Extensions
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈