GET and FIND('=')

Hello Reader,

Similarity/ Diffrnce in Function GET and FIND('=').

Lets differentiate by example
FIND('=')
The following example shows how use the FIND function to find a record in a table. The code sets the number of the record to find to 1100, which is the primary key of the record to find. The FIND function uses the '=' parameter to find the record that has a primary value that equals the specified primary key. If the record is found, then the item number, description, and unit price of the item are displayed in a message box. Otherwise, a message that specifies that the item is not found is displayed. This example requires that you create the following variables and text constants in the C/AL Globals window.
Variable name     DataType              Subtype
ItemRec Record Item
Text constant ENU value
Text000                                 Item No. %1.\Description: %2. Price: $%3.
Text001                                 The item was not found.

CODE 

ItemRec."No." := '1100';
IF ItemRec.FIND('=') THEN
  MESSAGE(TEXT000,  ItemRec."No.", ItemRec.Description, ItemRec."Unit Price")
ELSE
  MESSAGE(TEXT001);
 
GET 

IF CustomerRec.GET('4711') THEN
    .... // Do some processing.
ELSE
    .... // Do some error processing.
 
GET searches for the records, regardless of the current filters, and it does not change any filters. GET always searches through all the records in a table.

Difference

FIND ('=') is more similar to GET function: the difference between those 2 is that
GET ignores any filter applied to the set

Comments