FieldRef Data Type

Version: Available or changed with runtime version 1.0.

Identifies a field in a table and gives you access to this field.

The following methods are available on instances of the FieldRef data type.

Method name Description
Active() Checks whether the field that is currently selected is enabled.
CalcField() Updates FlowFields in a record.
CalcSum() Calculates the total of all values of a SumIndexField in a table.
Caption() Gets the current caption of a field as a String.
Class() Gets the value of the FieldClass Property of the field that is currently selected. This method returns an error if no field is selected.
EnumValueCount() Gets the number of Enum values (or Option members) from the Enum metadata for the field that is currently selected.
FieldError([String]) Stops the execution of the code, causing a run-time error, and creates an error message for a field.
GetEnumValueCaption(Integer) Gets an Enum value (or Option member) caption for the from the Enum metadata for the field that is currently selected.
GetEnumValueCaptionFromOrdinalValue(Integer) Gets an Enum value (or Option member) caption for the from the Enum metadata for the field that is currently selected.
GetEnumValueName(Integer) Gets an Enum value (or Option member) name from the Enum metadata for the field that is currently selected.
GetEnumValueNameFromOrdinalValue(Integer) Gets an Enum value (or Option member) name from the Enum metadata for the field that is currently selected.
GetEnumValueOrdinal(Integer) Gets the Enum value (or Option member) ordinal value from the Enum metadata for the field that is currently selected.
GetFilter() Gets the filter that is currently applied to the field referred to by FieldRef.
GetRangeMax() Gets the maximum value in a range for a field.
GetRangeMin() Gets the minimum value in a range for a field.
Length() Gets the maximum size of the field (the size specified in the DataLength property of the field). This method is usually used for finding the defined length of code and text fields.
Name() Gets the name of a field as a string.
Number() Gets the number of a field as an integer.
OptionCaption() Gets the option caption of the field that is currently selected.
OptionMembers() Gets the list of options that are available in the field that is currently selected.
OptionString() The 'OptionString' property has been deprecated and will be removed in the future. Use the 'OptionMembers' property instead.
Record() Gets the RecordRef of the field that is currently selected. This method returns an error if no field is selected.
Relation() Finds the table relationship of a given field.
SetFilter(String [, Any,...]) Assigns a filter to a field that you specify.
SetRange([Any] [, Any]) Sets a simple filter on a field, such as a single range or a single value.
TestField() Determines whether the contents of a field matches a given value. If the contents differ from the given value, an error message is displayed.
TestField(Byte) Determines whether the contents of a field matches a given value. If the contents differ from the given value, an error message is displayed.
TestField(Boolean) Determines whether the contents of a field matches a given value. If the contents differ from the given value, an error message is displayed.
TestField(Char) Determines whether the contents of a field matches a given value. If the contents differ from the given value, an error message is displayed.
TestField(Option) Determines whether the contents of a field matches a given value. If the contents differ from the given value, an error message is displayed.
TestField(Integer) Determines whether the contents of a field matches a given value. If the contents differ from the given value, an error message is displayed.
TestField(BigInteger) Determines whether the contents of a field matches a given value. If the contents differ from the given value, an error message is displayed.
TestField(Decimal) Determines whether the contents of a field matches a given value. If the contents differ from the given value, an error message is displayed.
TestField(Guid) Determines whether the contents of a field matches a given value. If the contents differ from the given value, an error message is displayed.
TestField(String) Determines whether the contents of a field matches a given value. If the contents differ from the given value, an error message is displayed.
TestField(Label) Determines whether the contents of a field matches a given value. If the contents differ from the given value, an error message is displayed.
TestField(Text) Determines whether the contents of a field matches a given value. If the contents differ from the given value, an error message is displayed.
TestField(Code) Determines whether the contents of a field matches a given value. If the contents differ from the given value, an error message is displayed.
TestField(Date) Determines whether the contents of a field matches a given value. If the contents differ from the given value, an error message is displayed.
TestField(DateTime) Determines whether the contents of a field matches a given value. If the contents differ from the given value, an error message is displayed.
TestField(Time) Determines whether the contents of a field matches a given value. If the contents differ from the given value, an error message is displayed.
TestField(Variant) Determines whether the contents of a field matches a given value. If the contents differ from the given value, an error message is displayed.
TestField(Enum) Determines whether the contents of a field matches a given value. If the contents differ from the given value, an error message is displayed.
TestField(Any) Determines whether the contents of a field matches a given value. If the contents differ from the given value, an error message is displayed.
Type() Gets the data type of the field that is currently selected.
Validate([Any]) Use this method to enter a new value into a field and have the new value validated by the properties and code that have been defined for that field.
Value([Any]) Sets or gets the value of the field that is currently selected. This method returns an error if no field is selected.

See Also

Getting Started with AL
Developing Extensions