Finds a record based on values stored in primary key fields.
|
[Ok :=] Record.GET([Value] ,...)
|
Parameters
- Record
-
Type: Record
The record in the table.
- Value,…
-
Type: any
Values in primary key fields. The data type of this parameter
must match the data type of the corresponding primary key field.
For example, if you enter an integer, the data type of the
corresponding primary key field must also be an integer. The value
0 (zero) or an empty string is assigned to unspecified fields.
Property Value/Return Value
Type: Boolean
true if the record was found; otherwise,
false.
If you omit this optional return value and if the record cannot
be found, a run-time error occurs. If you include the return value,
you must handle any errors.
Remarks
Example
This example requires that you create the following
variable and text constants in the C/AL Globals window.
Variable name |
DataType |
Subtype |
CustomerRec
|
Record
|
Customer
|
Text constant |
ENU value |
Text000
|
The record was found.
|
Text001
|
The record could not be found.
|
|
Copy Code |
CustomerRec.GET('1120');
// This statement causes a run-time error if customer 1120 cannot be
// found. To avoid this, use the following construct:
IF CustomerRec.GET('1120') THEN
MESSAGE(Text000)
ELSE
MESSAGE(Text001);
|
See Also