Interface "Record Reference"
The Record Reference interface provides a method for delegating read/write operations for tables that require indirect permissions.
Methods
ReadPermission
Determines if you can read from a table.
procedure ReadPermission(RecordRef: RecordRef): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| RecordRef | RecordRef |
An instance of the RecordRef data type. |
Returns
| Type | Description |
|---|---|
| Boolean |
true if you can read from some or all of the table; otherwise, false. |
WritePermission
Determines if you can write to a table.
procedure WritePermission(RecordRef: RecordRef): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| RecordRef | RecordRef |
An instance of the RecordRef data type. |
Returns
| Type | Description |
|---|---|
| Boolean |
Specifies if you have permission to write to the table |
Count
Counts the number of records that are in the filters that are currently applied to the table referred to by the RecordRef.
procedure Count(RecordRef: RecordRef): Integer
Parameters
| Name | Type | Description |
|---|---|---|
| RecordRef | RecordRef |
An instance of the RecordRef data type. |
Returns
| Type | Description |
|---|---|
| Integer |
The number of records in the table. |
CountApprox
Gets an approximate count of the number of records in the table
procedure CountApprox(RecordRef: RecordRef): Integer
Parameters
| Name | Type | Description |
|---|---|---|
| RecordRef | RecordRef |
An instance of the RecordRef data type. |
Returns
| Type | Description |
|---|---|
| Integer |
Approximate number of records in the table. |
IsEmpty
Determines whether any records exist in a filtered set of records in a table.
procedure IsEmpty(RecordRef: RecordRef): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| RecordRef | RecordRef |
An instance of the RecordRef data type. |
Returns
| Type | Description |
|---|---|
| Boolean |
true if the record or table is empty; otherwise, false. |
Find
Finds a record in a table based on the values stored in the key fields.
procedure Find(RecordRef: RecordRef, Which: Text)
Parameters
| Name | Type | Description |
|---|---|---|
| RecordRef | RecordRef |
An instance of the RecordRef data type. |
| Which | Text |
Specifies how to perform the search. |
Find
Finds a record in a table based on the values stored in the key fields.
procedure Find(RecordRef: RecordRef, Which: Text, UseReturnValue: Boolean): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| RecordRef | RecordRef |
An instance of the RecordRef data type. |
| Which | Text |
Specifies how to perform the search. |
| UseReturnValue | Boolean |
If you set UseReturnValue to false and the operation does not execute successfully, a runtime error will occur. |
Returns
| Type | Description |
|---|---|
| Boolean |
true if the operation was successful; otherwise false. |
FindLast
Finds the last record in a table based on the current key and filter.
procedure FindLast(RecordRef: RecordRef)
Parameters
| Name | Type | Description |
|---|---|---|
| RecordRef | RecordRef |
An instance of the RecordRef data type. |
FindLast
Finds the last record in a table based on the current key and filter.
procedure FindLast(RecordRef: RecordRef, UseReturnValue: Boolean): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| RecordRef | RecordRef |
An instance of the RecordRef data type. |
| UseReturnValue | Boolean |
If you set UseReturnValue to false and the operation does not execute successfully, a runtime error will occur. |
Returns
| Type | Description |
|---|---|
| Boolean |
true if the operation was successful; otherwise false. |
FindFirst
Finds the first record in a table based on the current key and filter.
procedure FindFirst(RecordRef: RecordRef)
Parameters
| Name | Type | Description |
|---|---|---|
| RecordRef | RecordRef |
An instance of the RecordRef data type. |
FindFirst
Finds the first record in a table based on the current key and filter.
procedure FindFirst(RecordRef: RecordRef, UseReturnValue: Boolean): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| RecordRef | RecordRef |
An instance of the RecordRef data type. |
| UseReturnValue | Boolean |
If you set UseReturnValue to false and the operation does not execute successfully, a runtime error will occur. |
Returns
| Type | Description |
|---|---|
| Boolean |
true if the operation was successful; otherwise false. |
FindSet
Finds a set of records in a table based on the current key and filter. FINDSET can only retrieve records in ascending order.
procedure FindSet(RecordRef: RecordRef)
Parameters
| Name | Type | Description |
|---|---|---|
| RecordRef | RecordRef |
An instance of the RecordRef data type. |
FindSet
Finds a set of records in a table based on the current key and filter. FINDSET can only retrieve records in ascending order.
procedure FindSet(RecordRef: RecordRef, UseReturnValue: Boolean): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| RecordRef | RecordRef |
An instance of the RecordRef data type. |
| UseReturnValue | Boolean |
If you set UseReturnValue to false and the operation does not execute successfully, a runtime error will occur. |
Returns
| Type | Description |
|---|---|
| Boolean |
true if the operation was successful; otherwise false. |
FindSet
Finds a set of records in a table based on the current key and filter. FINDSET can only retrieve records in ascending order.
procedure FindSet(RecordRef: RecordRef, ForUpdate: Boolean, UpdateKey: Boolean, UseReturnValue: Boolean): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| RecordRef | RecordRef |
An instance of the RecordRef data type. |
| ForUpdate | Boolean |
Set this parameter to false if you do not want to modify any records in the set. |
| UpdateKey | Boolean |
This parameter only applies if ForUpdate is true. If you are going to modify any field value within the current key, set this parameter to true. |
| UseReturnValue | Boolean |
If you set UseReturnValue to false and the operation does not execute successfully, a runtime error will occur. |
Returns
| Type | Description |
|---|---|
| Boolean |
true if the operation was successful; otherwise false. |
Next
Steps through a specified number of records and retrieves a record.
procedure Next(RecordRef: RecordRef, Steps: Integer): Integer
Parameters
| Name | Type | Description |
|---|---|---|
| RecordRef | RecordRef |
An instance of the RecordRef data type. |
| Steps | Integer |
Defines the direction of the search and how many records to step include. |
Returns
| Type | Description |
|---|---|
| Integer |
the direction of the search and how many steps taken. |
Next
Steps through a specified number of records and retrieves a record.
procedure Next(RecordRef: RecordRef): Integer
Parameters
| Name | Type | Description |
|---|---|---|
| RecordRef | RecordRef |
An instance of the RecordRef data type. |
Returns
| Type | Description |
|---|---|
| Integer |
the direction of the search and how many steps taken. |
Get
Gets a record based on the ID of the record.
procedure Get(RecordRef: RecordRef, RecordId: RecordId)
Parameters
| Name | Type | Description |
|---|---|---|
| RecordRef | RecordRef |
An instance of the RecordRef data type. |
| RecordId | RecordId |
The RecordID that contains the table number and the primary key of the table and is used to identify the record that you want to get. |
Get
Gets a record based on the ID of the record.
procedure Get(RecordRef: RecordRef, RecordId: RecordId, UseReturnValue: Boolean): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| RecordRef | RecordRef |
An instance of the RecordRef data type. |
| RecordId | RecordId |
The RecordID that contains the table number and the primary key of the table and is used to identify the record that you want to get. |
| UseReturnValue | Boolean |
If you set UseReturnValue to false and the operation does not execute successfully, a runtime error will occur. |
Returns
| Type | Description |
|---|---|
| Boolean |
true if the operation was successful; otherwise false. |
GetBySystemId
Gets a record based on the ID of the record. The RecordRef must already be opened.
procedure GetBySystemId(RecordRef: RecordRef, SystemId: Guid)
Parameters
| Name | Type | Description |
|---|---|---|
| RecordRef | RecordRef |
An instance of the RecordRef data type. |
| SystemId | Guid |
The systemid which uniquely identifies the record that you want to get. |
GetBySystemId
Gets a record based on the ID of the record. The RecordRef must already be opened.
procedure GetBySystemId(RecordRef: RecordRef, SystemId: Guid, UseReturnValue: Boolean): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| RecordRef | RecordRef |
An instance of the RecordRef data type. |
| SystemId | Guid |
The systemid which uniquely identifies the record that you want to get. |
| UseReturnValue | Boolean |
If you set UseReturnValue to false and the operation does not execute successfully, a runtime error will occur. |
Returns
| Type | Description |
|---|---|
| Boolean |
true if the operation was successful; otherwise false. |
Insert
Inserts a record into a table.
procedure Insert(RecordRef: RecordRef, RunTrigger: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| RecordRef | RecordRef |
An instance of the RecordRef data type. |
| RunTrigger | Boolean |
If this parameter is true, the code in the OnInsert Trigger is executed. |
Insert
Inserts a record into a table.
procedure Insert(RecordRef: RecordRef, RunTrigger: Boolean, UseReturnValue: Boolean): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| RecordRef | RecordRef |
An instance of the RecordRef data type. |
| RunTrigger | Boolean |
If this parameter is true, the code in the OnInsert Trigger is executed. |
| UseReturnValue | Boolean |
If you set UseReturnValue to false and the operation does not execute successfully, a runtime error will occur. |
Returns
| Type | Description |
|---|---|
| Boolean |
true if the operation was successful; otherwise false. |
Insert
Inserts a record into a table.
procedure Insert(RecordRef: RecordRef, RunTrigger: Boolean, InsertWithSystemId: Boolean, UseReturnValue: Boolean): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| RecordRef | RecordRef |
An instance of the RecordRef data type. |
| RunTrigger | Boolean |
If this parameter is true, the code in the OnInsert Trigger is executed. |
| InsertWithSystemId | Boolean |
If this parameter is true, the SystemId field of the record is given a value that you explicitly assign. |
| UseReturnValue | Boolean |
If you set UseReturnValue to false and the operation does not execute successfully, a runtime error will occur. |
Returns
| Type | Description |
|---|---|
| Boolean |
true if the operation was successful; otherwise false. |
Modify
Modifies a record in a table.
procedure Modify(RecordRef: RecordRef, RunTrigger: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| RecordRef | RecordRef |
An instance of the RecordRef data type. |
| RunTrigger | Boolean |
Specifies whether to run the AL code in the OnModify Trigger. |
Modify
Modifies a record in a table.
procedure Modify(RecordRef: RecordRef, RunTrigger: Boolean, UseReturnValue: Boolean): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| RecordRef | RecordRef |
An instance of the RecordRef data type. |
| RunTrigger | Boolean |
Specifies whether to run the AL code in the OnModify Trigger. |
| UseReturnValue | Boolean |
If you set UseReturnValue to false and the operation does not execute successfully, a runtime error will occur. |
Returns
| Type | Description |
|---|---|
| Boolean |
true if the operation was successful; otherwise false. |
Delete
Deletes a record in a table.
procedure Delete(RecordRef: RecordRef, RunTrigger: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| RecordRef | RecordRef |
An instance of the RecordRef data type. |
| RunTrigger | Boolean |
Specifies whether the code in the OnDelete trigger will be executed. |
Delete
Deletes a record in a table.
procedure Delete(RecordRef: RecordRef, RunTrigger: Boolean, UseReturnValue: Boolean): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| RecordRef | RecordRef |
An instance of the RecordRef data type. |
| RunTrigger | Boolean |
Specifies whether the code in the OnDelete trigger will be executed. |
| UseReturnValue | Boolean |
If you set UseReturnValue to false and the operation does not execute successfully, a runtime error will occur. |
Returns
| Type | Description |
|---|---|
| Boolean |
true if the operation was successful; otherwise false. |
DeleteAll
Deletes all records in a table that fall within a specified range.
procedure DeleteAll(RecordRef: RecordRef, RunTrigger: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| RecordRef | RecordRef |
An instance of the RecordRef data type. |
| RunTrigger | Boolean |
Specifies whether the code in the OnDelete trigger will be executed. |