Find('=<>')

nikeman77nikeman77 Member Posts: 517
Hi,

anyone knows what symbol is it ?

Table: 554,
Name: Analysis by Dimensions
Functions: ValidateAnalysisViewCode()

If AnalysisView.Find('=<>')

Answers

  • BeliasBelias Member Posts: 2,998
    from (a piece of) F1 help:
    = 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
  • nikeman77nikeman77 Member Posts: 517
    Belias wrote:
    from (a piece of) F1 help:
    unfortunately, can't find them :(
    Belias wrote:
    = 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
    Belias wrote:
    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.
    ok, thanks a lot, Belias... :D
  • BeliasBelias Member Posts: 2,998
    nikeman77 wrote:
    unfortunately, can't find them :(
    enter in a codeunit, hit f1, search "find", fifth result.
    nikeman77 wrote:
    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 :wink: )
    nikeman77 wrote:
    ok, thanks a lot, Belias... :D
    you're welcome
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • nikeman77nikeman77 Member Posts: 517
    Belias wrote:
    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]
    Belias wrote:
    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 :wink: )
    can't find '=<>' in f1
    Belias wrote:
    you're welcome
    :D
  • BeliasBelias Member Posts: 2,998
    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>.
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • nikeman77nikeman77 Member Posts: 517
    Belias wrote:
    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....

    :whistle:
  • BeliasBelias Member Posts: 2,998
    :thumbsup:
    i thought this was clear
    in other words, the system will try to find one record as close as possible to the supplied key values.
    i gotta improve my english
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • nikeman77nikeman77 Member Posts: 517
    belias,
    it was clear no doubt about it, just my poor understanding :)
  • David_SingletonDavid_Singleton Member Posts: 5,479
    edited 2012-04-16
    nikeman77 wrote:
    Find('=<>')

    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('-');
    David Singleton
  • BeliasBelias Member Posts: 2,998
    edited 2012-04-16
    actually, ->< is different than =>< ...
    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
  • David_SingletonDavid_Singleton Member Posts: 5,479
    Belias wrote:
    actually, ->< is different than =>< ...

    Thanks for pointing out the typo.
    David Singleton
  • BeliasBelias Member Posts: 2,998
    Thanks for pointing out the typo.
    #-o oh, sorry...it was just a typo...how could i've had doubt on you, david :mrgreen:
    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
  • David_SingletonDavid_Singleton Member Posts: 5,479
    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.
    David Singleton
  • BeliasBelias Member Posts: 2,998
    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. :mrgreen: - 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
  • David_SingletonDavid_Singleton Member Posts: 5,479
    Belias wrote:
    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?
    David Singleton
  • David_SingletonDavid_Singleton Member Posts: 5,479

    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('=<>'); ?
    David Singleton
  • BeliasBelias Member Posts: 2,998
    during ValidateAnalysisViewCode() function in standard page 554... :mrgreen: (no time to investigate today :( )
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
Sign In or Register to comment.