# RecordRef.FindSet([Boolean]) Method
> Version: _Available or changed with runtime version 1.0._
Finds a set of records in a table based on the current key and filter. FINDSET can only retrieve records in ascending order.
## Syntax
```al
[Ok := ]  RecordRef.FindSet([ForUpdate: Boolean])
```
## Parameters
RecordRef
Type: recordref-data-type
An instance of the recordref-data-type data type.
*[Optional] ForUpdate*
Type: ../boolean/boolean-data-type
Set this parameter to false if you do not want to modify any records in the set. Set this parameter to true if you want to modify records in the set. If you set this parameter to true, then the records will be read with Updlock.
## Return Value
*[Optional] Ok*
Type: ../boolean/boolean-data-type
true if the operation was successful; otherwise false. If you omit this optional return value and the operation does not execute successfully, a runtime error will occur.
## Remarks
You should use this method only when you explicitly want to loop through a recordset. You should only use this method in combination with repeat..until.
The difference between `Find()` and FindSet is that Find uses paging and the method only requests N rows in the first request, and then if you need more rows, it'll submit a new SQL request. The FindSet method will request all rows at once.
The difference between `FindSet(false)` and `FindSet(true)` is that `FindSet(true)` reads the records with Updlock, which is an advantage if you plan to update all the rows you find.
This method works the same way as the ../record/record-findset-boolean-method.
## Example
The following example opens table 18 Customer as a RecordRef variable that is named MyRecordRef. The recordref-field-method creates a FieldRef variable that is named MyFieldRef with the first field \(No.\). The ../fieldref/fieldref-setfilter-method uses the MyFieldRef variable to set a filter that selects records from 30000 to 32000. `MyRecordRef.Field(2)` creates a FieldRef for the second field \(Name\). The FindSet method finds the set of records based on the key and the filters that have been set. The ForUpdate parameter is set to False. This makes the records in the set read-only. The record ID and name of each customer in the record set is displayed in a message box until no records are left in the record set.
```al
var
    MyRecordRef: RecordRef;
    MyFieldRef: FieldRef;
    Text000: Label '%1: "%2" is found in the set of records.';
begin
    MyRecordRef.Open(18);
    MyFieldRef := MyRecordRef.Field(1);
    MyFieldRef.SetFilter('30000..32000');
    MyFieldRef := MyRecordRef.Field(2);
    if MyRecordRef.FindSet(False) then begin
      repeat
        Message(Text000 , MyRecordRef.RecordId, MyFieldRef.Value);
      until MyRecordRef.Next = 0;
    end;
end;
```
## Related information
recordref-data-type
Getting Started with AL<../../devenv-get-started>
Developing Extensions<../../devenv-dev-overview>

Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/recordref/recordref-findset-boolean-method, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact. https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/recordref/recordref-findset-boolean-method/
