= 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
If this parameter contains '=', '>' or '<', then you must assign value to all fields of the current and primary keys before you call FIND.
if you use that "Find('=<>')" the system will try to do the find with the "=", then with the "<" and then with the ">" parameter (i don't know if this actually fires 3 quereies to SQL :-k ).
in other words, the system will try to find one record as close as possible to the supplied key values.
-Mirko-
"Never memorize what you can easily find in a book".....Or Mibuso My Blog
= 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
If this parameter contains '=', '>' or '<', then you must assign value to all fields of the current and primary keys before you call FIND.
if its this case, it would be the same as If Record.Get("Primary Key1", "Primary Key2")Then
if you use that "Find('=<>')" the system will try to do the find with the "=", then with the "<" and then with the ">" parameter (i don't know if this actually fires 3 quereies to SQL :-k ).
in other words, the system will try to find one record as close as possible to the supplied key values.
if its this case, it would be the same as If Record.Get("Primary Key1", "Primary Key2")Then
NOPE, record.get don't care about filters on the record, and return false if the record si not exactly the one with the specified key values. (all this stuff is in the F1 help )
enter in a codeunit, hit f1, search "find", fifth result.
codeunit>> you mean object designer/ codeunit/ hit f1 ? the 5th record = [Linking Documents, Folders, or Web Sites to Records in Microsoft Dynamics NAV]
NOPE, record.get don't care about filters on the record, and return false if the record si not exactly the one with the specified key values. (all this stuff is in the F1 help )
search the F1 help for "find" word...
there's not the help for Find('=<>') because it's just the compound of three statements: find=, find<, find>.
belias,
finally i get it... system will find for value equalvalent to, cant find will proceed to get the value smaller & nearest to the value, if still cant find then will find the next nearest bigger ones....
clear(mytable);
mytable.mykeyfield1 := 1;
mytable.mykeyfield1 := 'A';
mytable.find('-><'); //this will always find the first record in the table, if any
mytable.find('=><'); //this will find record 1-A if existing, otherwise it will try to find 1-B and then 1-(blank) for example
also, '<' and '>' parameters for the find, has not a "substitute" on sql database...Ok, they're not used so frequently, but sometimes they're useful (e.g.: i used FIND('=<>') recently in RTC)
-Mirko-
"Never memorize what you can easily find in a book".....Or Mibuso My Blog
#-o oh, sorry...it was just a typo...how could i've had doubt on you, david
PS: i also edited my previous post while you were answering, i added something on '>' and '<'...in case you missed the edited post
-Mirko-
"Never memorize what you can easily find in a book".....Or Mibuso My Blog
The only reason I could see for using find('=<>') would be for the visual effect of positioning the cursor on a form to replicate in code the default behavior in opening a form.
The only reason I could see for using find('=<>') would be for the visual effect of positioning the cursor on a form to replicate in code the default behavior in opening a form.
:thumbsup: exactly.
i have a page that interfaces with unposted orders and journals coming from palm device. it is based on a temporary table and the user can post related documents/journals directly from this page. As it is a temporary table, as soon as a journal/document is posted, the table should be recalculated, and the cursor repositioned correctly (or the user gets lost every time he refreshes the temporary table).
NOTE(for completeness): i do not recalculate the table every time the user post something from it...he has to hit a "refresh" action. - here's the code.
//note: savedoldview and savedoldrecord must be temporary, otherwise the RESET instruction clears them
SavedOldView := GETVIEW;
SavedOldRecord := Rec;
RESET;
DELETEALL;
FillTempTable;
SETVIEW(SavedOldView);
Rec := SavedOldRecord;
IF FIND('=><') THEN;
-Mirko-
"Never memorize what you can easily find in a book".....Or Mibuso My Blog
The only reason I could see for using find('=<>') would be for the visual effect of positioning the cursor on a form to replicate in code the default behavior in opening a form.
IF FIND('=><') THEN;
but thats not the same is it? I thought default action in forms was that if the record does notexist then go to the record prior not the next one?
Answers
in other words, the system will try to find one record as close as possible to the supplied key values.
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
if its this case, it would be the same as If Record.Get("Primary Key1", "Primary Key2")Then
ok, thanks a lot, Belias...
NOPE, record.get don't care about filters on the record, and return false if the record si not exactly the one with the specified key values. (all this stuff is in the F1 help )
you're welcome
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
can't find '=<>' in f1
there's not the help for Find('=<>') because it's just the compound of three statements: find=, find<, find>.
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
finally i get it... system will find for value equalvalent to, cant find will proceed to get the value smaller & nearest to the value, if still cant find then will find the next nearest bigger ones....
:whistle:
i thought this was clear i gotta improve my english
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
it was clear no doubt about it, just my poor understanding
Actually it should be FIND('=><');
But in any case the command makes sense only on Native database.
In SQL use either FINDFIRST, FINDSET or FIND('-') depending on what you are trying to do. If you are not sure then you can always use FIND('-');
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Thanks for pointing out the typo.
PS: i also edited my previous post while you were answering, i added something on '>' and '<'...in case you missed the edited post
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
i have a page that interfaces with unposted orders and journals coming from palm device. it is based on a temporary table and the user can post related documents/journals directly from this page. As it is a temporary table, as soon as a journal/document is posted, the table should be recalculated, and the cursor repositioned correctly (or the user gets lost every time he refreshes the temporary table).
NOTE(for completeness): i do not recalculate the table every time the user post something from it...he has to hit a "refresh" action. - here's the code.
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
but thats not the same is it? I thought default action in forms was that if the record does notexist then go to the record prior not the next one?
Hmm just checked, and your are correct stadard form functionality is = > <
So I guess I can real ask my question, where would you ever use FIND('=<>'); ?
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog