Find Function

divyardivyar Member Posts: 17
edited 2015-03-03 in NAV Three Tier
Hi,
What is the use of Find('=>') ,Find('<='),Find('=') in nav 2013 r2. If i set value for the primary key,use any of the mentioned Find function and use repeat until with them,records are not getting filtered properly.

Test table has 4 records.No is the primary key.
No values-1,3,5,7

code:

test.No:=3;
if test.FIND('<=') then
REPEAT
MESSAGE('%1',test.No);
UNTIL test.NEXT=0;

output: 1,3,5,7

<= to search for a record that is less than or equal to the key values
Expected output: 1,3

Comments

  • kinekine Member Posts: 12,562
    1) Depends on sorting order (it means on current key). If sorted by anything other, it has no sense.
    2) FIND is never filtering. It is just finding the record. In your case, first record having No. = 3, if not exists, than previous one. If you want to filter, you need to use SETRANGE or SETFILTER.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.