Ok := Record.FINDSET([ForUpdate][, UpdateKey])
Use this function to find a set of records in a table based on the current key and filter. The records can only be
retrieved in ascending order. "ForUpdate": Set this to FALSE if you don't intend to modify any records in the set.
"ForUpdateKey": If you are going to modify any field value within the current key, set this parameter to TRUE.
And is supported from version 4.00SP1, if you are on NAV 4.00 w/o SP, you will not see the commands in the F5 menu. Check the client version in About dialog.
And is supported from version 4.00SP1, if you are on NAV 4.00 w/o SP, you will not see the commands in the F5 menu. Check the client version in About dialog.
About Box says Version W1 4.0 SP1 (4.0)
and when i press F5->Record->miscellaneous->I dont see FINDSET in the List :shock:
And is supported from version 4.00SP1, if you are on NAV 4.00 w/o SP, you will not see the commands in the F5 menu. Check the client version in About dialog.
About Box says Version W1 4.0 SP1 (4.0)
and when i press F5->Record->miscellaneous->I dont see FINDSET in the List :shock:
Yes, because you are using W1 4.0 SP1 database opened with NAV 4.00 w/o SP...
I also get the impression from the help file that FINDFIRST is more optimal but only if you intend to FINDFIRST and not USE NEXT.
However if you intend to do something like IF FIND('-') THEN REPEAT UNTIL NEXT = 0....
then you should never use FINDFIRST here.
Have I got that right or am I wrong? I am basing this guess on the help file saying "This function should be used instead of FIND('-') when you only need the first record."
New commands:
FINDSET: for getting multiple records, you intend to loop through them
FINDFIRST: for getting only the first record in the filter, just one record
FINDLAST: for getting only the last record in the filter, just one record
When you only want to know if records exist at all, when you don't need any field values from any records, you should use ISEMPTY
New commands:
FINDSET: for getting multiple records, you intend to loop through them
FINDFIRST: for getting only the first record in the filter, just one record
FINDLAST: for getting only the last record in the filter, just one record
Hi DenSter,
I want to ask whether FIND or FIND('=') is same with FINDFIRST?
If it's different, what is the different?
no, they are different:
if you check the F1 help of nav you will find that
Finds a record in a C/SIDE table based on the values stored in keys.
Ok := Record.FIND([Which])
Parameters
Record
Type: Record
On input, Record identifies the record that you want to find. On output, the following possibilities exist:
If the record was found, then the record is returned in the Record parameter and any FlowFields in the record are set to zero. You must update the FlowFields using the CALCFIELDS Function (RECORD).
If the record was not found and if you omitted the return value, a runtime error occurs.
Which
Type: Text or code
Specifies how to perform the search. The table is searched until either a record is found or there are no more records. Each character in this string can be present only once. You can combine the '=', '<', and '>' characters. You can use the following characters:
= to search for a record that equals the key values (default)
> to search for a record that is larger than the key values
< to search for a record that is less than the key values
+ to search for the last record in the table (+ can only be used alone) - tosearch for the first record in the table (- can only be used alone)
If this parameter contains '=', '>' or '<', then you must assign value to all fields of the current and primary keys before you call FIND.
FIND('=') is more similar to GET function: the difference between those 2 is that GET ignores any filter applied to the set.
-Mirko-
"Never memorize what you can easily find in a book".....Or Mibuso My Blog
Comments
Use this function to find a set of records in a table based on the current key and filter. The records can only be
retrieved in ascending order. "ForUpdate": Set this to FALSE if you don't intend to modify any records in the set.
"ForUpdateKey": If you are going to modify any field value within the current key, set this parameter to TRUE.
GD
RIS Plus, LLC
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I made myself a rule:
- More than 500 records: Find('-')
- Less than 500 records: Findset
500 ist the default buffer of recordsets in the sql server....
edit:
Parameters for Findset:
findset(true, false); If you want to modify the records
findset(true, true); if you want to modify fields of the PK
About Box says Version W1 4.0 SP1 (4.0)
and when i press F5->Record->miscellaneous->I dont see FINDSET in the List :shock:
GD
Yes, because you are using W1 4.0 SP1 database opened with NAV 4.00 w/o SP...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
With FINDSET you intend to get a set of records, and with the parameters you can specify what you are going to do with those records.
FIND('-') is also used to get only the first record, for which you should now use FINDFIRST.
FIND('-') is also used to check whether records exist at all within the filtered values, for which it is better to use ISEMPTY.
RIS Plus, LLC
However if you intend to do something like IF FIND('-') THEN REPEAT UNTIL NEXT = 0....
then you should never use FINDFIRST here.
Have I got that right or am I wrong? I am basing this guess on the help file saying "This function should be used instead of FIND('-') when you only need the first record."
FINDSET: for getting multiple records, you intend to loop through them
FINDFIRST: for getting only the first record in the filter, just one record
FINDLAST: for getting only the last record in the filter, just one record
When you only want to know if records exist at all, when you don't need any field values from any records, you should use ISEMPTY
So the key to your question is
RIS Plus, LLC
Hi DenSter,
I want to ask whether FIND or FIND('=') is same with FINDFIRST?
If it's different, what is the different?
Thank you.
Johanna
if you check the F1 help of nav you will find that FIND('=') is more similar to GET function: the difference between those 2 is that GET ignores any filter applied to the set.
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
You could also use FIND('-') for multiple records when you use ASCENDING(FALSE), this will not work with a FINDSET.
Thank you for the information, Belias
Johanna
FINDSET(TRUE,FALSE) - This is used to update non-key fields. This uses a cursor with a fetch buffer similar to FIND(‘-’).
FINDSET(TRUE,TRUE) - This is used to update key fields.