Record Data Type

Is a complex data type.

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

Method name Description
FindFirst() Finds the first record in a table based on the current key and filter.
FindLast() Finds the last record in a table based on the current key and filter.
FindSet([Boolean] [, Boolean]) Finds a set of records in a table based on the current key and filter.
Get([Any,...]) Gets a record based on values stored in primary key fields.
Find([String]) Finds a record in a table that is based on the values stored in keys.
Next([Integer]) Steps through a specified number of records and retrieves a record.
Reset() Removes all filters, including any special filters set by MARKEDONLY, and changes the current key to the primary key. Also removes any marks on the record and clears any AL variables on the record.
SetCurrentKey(Any [, Any,...]) Selects a key for a table.
Ascending([Boolean]) Gets or sets the order in which the system searches through a table.
SetAscending(Any, Boolean) Sets the sort order for the records returned. Use this method after you have set the keys to sort after, using SETCURRENTKEY. The default sort order is ascending. You can use SETASCENDING to change the sort order to descending for a specific field, while the other fields in the specified key are sorted in ascending order.
GetAscending(Any) Gets the sort order for the records returned. You can use GETASCENDING to identify the sort order of the specified field because fields can be sorted in ascending or descending order. For example, you can read data from an ODATA web service where the data is sorted in ascending order on the Name field but in descending order on the City field.
LockTable([Boolean] [, Boolean]) Locks a table to protect it from write transactions that conflict with each other.
CalcFields(Any [, Any,...]) Calculates the FlowFields in a record. You specify which fields to calculate by using parameters.
CalcSums(Any [, Any,...]) Calculates the total of a column in a table. You specify which fields to calculate by using parameters.
SetAutoCalcFields([Any,...]) Sets the FlowFields that you specify to be automatically calculated when the record is retrieved from the database.
Count() Counts the number of records in a table.
IsEmpty() Determines whether a table or a filtered set of records is empty.
CountApprox() Returns an approximate count of the number of records in the table, for example, for updating progress bars or displaying informational messages.
TableName() Gets the name of a table.
TableCaption() Gets the current caption of a table as a string.
ChangeCompany([String]) Redirects references to table data from one company to another.
CurrentKey() Gets the current key of a database table.
Consistent(Boolean) Marks a table as being consistent or inconsistent.
GetPosition([Boolean]) Gets a string that contains the primary key of the current record.
SetPosition(String) Sets the fields in a primary key on a record to the values specified in the supplied string. The remaining fields are not changed.
Init() Initializes a record in a table.
Insert() Inserts a record into a table without executing the code in the OnInsert trigger.
Insert(Boolean) Inserts a record into a table.
Insert(Boolean, Boolean) Inserts a record into a table.
Modify([Boolean]) Modifies a record in a table.
Delete([Boolean]) Deletes a record in a table.
Rename(Any [, Any,...]) Changes the value of a primary key in a table.
ModifyAll(Any, Any [, Boolean]) Modifies a field in all records within a range that you specify.
DeleteAll([Boolean]) Deletes all records in a table that fall within a specified range.
ReadPermission() Determines whether a user is granted read permission to the table that contains a record. This method can test for both full read permission and partial read permission that has been granted with a security filter.
WritePermission() Determines whether a user can write to a table. This method can test for both full write permission and partial write permission that has been granted with a security filter. A write permission consists of Insert, Delete, and Modify permissions.
ReadConsistency() Determines if the table supports read consistency.
RecordLevelLocking() Determines whether the table supports record-level locking.
Copy(var Record [, Boolean]) Copies a specified record's filters, views, automatically calculated FlowFields, marks, fields, and keys that are associated with the record from a table or creates a reference to a record.
AddLink(String [, String]) Adds a link to a record.
DeleteLink(Integer) Deletes a specified link from a record in a table.
DeleteLinks() Deletes all of the links that have been added to a record.
CopyLinks(var Record) Copies all the links from a specified record.
CopyLinks(RecordRef) Copies all the links from a specified record.
HasLinks() Determines whether a record contains any links.
SetRange(Any [, Any] [, Any]) Sets a simple filter, such as a single range or a single value, on a field.
SetFilter(Any, String [, Any,...]) Assigns a filter to a field that you specify.
GetFilter(Any) Gets a list of the filters within the current filter group that are applied to a field.
GetFilters() Gets a string that contains a list of the filters within the current filter group for all fields in a record. In addition, this method also returns the state of the MARKEDONLY method (Record).
GetView([Boolean]) Gets a string that describes the current sort order, key, and filters on a table.
SetView(String) Sets the current sort order, key, and filters on a table.
GetRangeMin(Any) Gets the minimum value in a range for a field.
GetRangeMax(Any) Gets the maximum value in a range for a field.
CopyFilter(Any, Any) Copies the filter that has been set for one field and applies it to another field.
CopyFilters(var Record) Copies all the filters set by the SETFILTER method (Record) or the SETRANGE method (Record) from one record to another.
HasFilter() Determines whether a filter is attached to a record within the current filter group.
SetRecFilter() Sets the values in the current key of the current record as a record filter.
FilterGroup([Integer]) Gets or sets the filter group that is applied to a table.
SetPermissionFilter() Applies the user's security filter.
Mark([Boolean]) Marks a record. You can also use this method to determine whether a record is marked.
ClearMarks() Removes all the marks from a record.
MarkedOnly([Boolean]) Activates a special filter. After you use this function, your view of the table includes only records marked by this function.
Validate(Any [, Any]) Calls the OnValidate trigger for the field that you specify.
TestField(Any) Tests whether the contents of a field match a given value.
TestField(Any, Boolean) Tests whether the contents of a field match a given value.
TestField(Any, Integer) Tests whether the contents of a field match a given value.
TestField(Any, BigInteger) Tests whether the contents of a field match a given value.
TestField(Any, Decimal) Tests whether the contents of a field match a given value.
TestField(Any, Guid) Tests whether the contents of a field match a given value.
TestField(Any, Text) Tests whether the contents of a field match a given value.
TestField(Any, Label) Tests whether the contents of a field match a given value.
TestField(Any, TextConst) Tests whether the contents of a field match a given value.
TestField(Any, Code) Tests whether the contents of a field match a given value.
TestField(Any, String) Tests whether the contents of a field match a given value.
TestField(Any, Any) Tests whether the contents of a field match a given value.
FieldError(Any [, String]) Stops the execution of the code causing a run-time error, and creates an error message for a field.
TransferFields(var Record [, Boolean]) Copies all matching fields in one record to another record.
TransferFields(var Record, Boolean, Boolean) Copies all matching fields in one record to another record.
FieldName(Any) Gets the name of a field as a string.
FieldCaption(Any) Gets the current caption of the specified field as a string.
FieldActive(Any) Checks whether a field is enabled.
FieldNo(Any) Gets the number assigned to a field in the table description.
Relation(Any) Determines the table relationship of a given field.
SecurityFiltering([SecurityFilter])
RecordId()
IsTemporary() Determines whether a record refers to a temporary table.
CurrentCompany() Gets the current company of a database table record.
GetBySystemId(Guid) Gets a record by its SystemId.

See Also

Getting Started with AL
Developing Extensions