C/AL Code

Stan09
Member Posts: 63
Hi,
What is the meaning of this record filter:
record.find('=<>').
thank you for your answer.
What is the meaning of this record filter:
record.find('=<>').
thank you for your answer.
0
Comments
-
Stan09 wrote:Hi,
What is the meaning of this record filter:
record.find('=<>').
thank you for your answer.
The system will first try to find a record that matches, otherwise it will find the record before, or the record after.There are no bugs - only undocumented features.0 -
Hi,
I think that is called the "find nearest" or "find any".
This was used in old versions, here is the help description from version 2.6.
That might help you.
[Ok :=] Record.FIND([Which])
Ok
Data type: boolean
If you omit this optional return value, a run-time error occurs if the system cannot find the record. If you include a return value, the system assumes you will handle any errors. Ok can have these values:
If Ok is... It means the record was...
TRUE Found
FALSE Not found
Record
Data type: record
On input, Record identifies the record you want the system to find. On output, there are two possibilities:
If the record was... Then...
Found The system returns the record in Record and sets any FlowFields in the record to zero. You must update them using CALCFIELDS.
Not found A run-time error occurs, if you omitted the return value Ok.
Which
Data type: text or code
Tells the system how to perform the search. The system searches through the table until either it finds the record or there are no more records. Each character in this string can be present only once. You can combine the '=', '<' and '>' characters.
This... Tells the system to search for...
'=' A record that equals the key values (default)
'>' A record that is larger than the key values
'<' A record that is less the key values
'+' The last record in the table ('+' can only be used alone)
'-' The first record in the table ('-' can only be used alone)
If SearchStr contains '=', '>' or '<', you must assign values to all fields of the current and primary keys before you call FIND.
Comments
FIND retrieves the first record that meets the conditions set by SearchStr and the filters associated with Record. The search path reflects the sort order defined by the current key. If the current key is not the primary key, there is a chance that several records might have the same values in current key fields. If this happens, the system uses the sort order defined by the primary key as the search path.
Example
This C/AL code shows how to use the FIND function.
d.OPEN('Search for customer number...\'
+ '#1##################');
d.INPUT(1, Customer."No.");
IF Customer.FIND THEN
MESSAGE('The customer was found.\' +
'Customer No. %1 is:\' +
'%2', Customer."No.", Customer.Name)
ELSE
MESSAGE('Sorry, that customer could not be found...');
First, the system prompts you to enter a customer number to search for:
Search for customer number...
If the number you enter does not exist, the system displays this message:
Sorry, that customer could not be found...
If the system finds the number in the Customer table, it could display:
The customer was found.
Customer number AAA 1050 is:
AAA Furniture Manufacturing
Regards,
WillyFostering a homeless, abused child is the hardest yet most rewarding thing I have ever done.0 -
Read this http://www.mibuso.com/howtoinfo.asp?FileID=22 about record.find('=<>') and lots of other useful tips about C/AL.0
-
Thank you very much, your help is useful.0
-
FIND('=><') is pretty much redundant now with cached RAID arrays.
In simple terms when Navision was able to directly interact with disks, the function was faster in some cases. Now it offers no benefit.
In most cases you can use FIND('-'), FINDFIRST, or FINDSET to get the same result. In some cases the best option is to use ISEMPTY. But you need to look at what the code is doing and make the right change.David Singleton0 -
FIND('=><') is used to find the closest record if an exact match cannot be found.There are no bugs - only undocumented features.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions