FLASH Question: is there another record after this?

Belias
Member Posts: 2,998
is there a NAV built-in function which determine if there are further records after the current one?
(I don't want to step using NEXT, or use FINDLAST and compare the two records)
I don't know what to search in the help
A Quick answer is appreciated...holyday is incoming!
(I don't want to step using NEXT, or use FINDLAST and compare the two records)
I don't know what to search in the help
A Quick answer is appreciated...holyday is incoming!


0
Answers
-
FIND('>')
Take care of the current key and all filters set."Money is likewise the greatest chance and the greatest scourge of mankind."0 -
yes, but it changes the reference to the record...my problem is that I don't want to change the reference the current record...it's hard to explain why I have to do this, but this is my problem...0
-
Then just take another record variable of the same type, fill in the key fields of the current key (or for all I care copy the complete record) and use FIND('>') with your second record variable.
Maybe I don't understand the problem?! :?"Money is likewise the greatest chance and the greatest scourge of mankind."0 -
You can also set a filter based on your current key and then use ISEMPTY. After that you can solve the filter and your record variable shouldn't refer to another record.
I mean something like thatCust.GET('100011'); Cust.SETFILTER("No.",'>%1',Cust."No."); IF Cust.ISEMPTY THEN BEGIN Cust.SETRANGE("No."); ... END ELSE BEGIN Cust.SETRANGE("No."); ... END;
"Money is likewise the greatest chance and the greatest scourge of mankind."0 -
I was on holiday...
...thanks...you understand the problem, but i will use a boolean...i hoped there was a particular function, but if I have to do all this...maybe it's faster and clearer to use boolean
byee!0 -
You can also try this:
This code has the performance-advantage that you do ONLY one extra read on the DB.recTheTable.RESET; recTheTable.SETCURRENTKEY(...); recTheTable.SETRANGE / SETFILTER(...); IF recTheTable.FINDLAST THEN recTheTableLAST := recTheTable; FINDSET; REPEAT IF (recTheTable."Primary Key Field 1" = recTheTableLAST."Primary Key Field 1") AND (recTheTable."Primary Key Field 2" = recTheTableLAST."Primary Key Field 2") AND .... THEN MESSAGE('Current Record is the last record in the filter'); ... other commands UNTIL recTheTable.NEXT = 0;
Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!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