Use of 'OnFindRecord' On 'OnNextRecord' - I'm almost there

jensthomsen
Member Posts: 173
On table 156 we have created a new option field 'Main_Sub' to allow us to have Main- and submachines in the same table. Now the challenge is to build a new page to illustrate the main-sub structure of a machine: One line would be the Main (Headerline) and under that we could have several sub-lines. I have tried with the following code ('BufferTable' is a new table with PK equal to "Code 1"):
***************
OnInit()
BufferTable."Code 1" := '1300';
BufferTable.Integer_1 := 1;
BufferTable.INSERT;
BufferTable."Code 1" := '1000';
BufferTable.Integer_1 := 2;
BufferTable.INSERT;
BufferTable."Code 1" := '1160';
BufferTable.Integer_1 := 3;
BufferTable.INSERT;
BufferTable."Code 1" := '1850';
BufferTable.Integer_1 := 4;
BufferTable.INSERT;
BufferTable.SETCURRENTKEY(Integer_1);
OnFindRecord(Which : Text) : Boolean
IF BufferTable.GET("No.") THEN;
IF NOT BufferTable.FIND(Which) THEN
EXIT(FALSE);
IF NOT GET(BufferTable."Code 1") THEN
EXIT(FALSE);
EXIT(TRUE);
OnNextRecord(Steps : Integer) : Integer
IF NOT BufferTable.GET("No.") THEN
EXIT(0);
CurrSteps := BufferTable.NEXT(Steps);
IF CurrSteps <> 0 THEN
IF NOT GET(BufferTable."Code 1") THEN
CurrSteps := 0;
EXIT(CurrSteps);
***************
The idea of the code is, that Machine No. '1300' is the Main Machine and therefore should be the Header-line in the page (and I could do some conditionalle formatting of the line). The code works ok: The Machine line is in fact in top of the page....But it's not possible to do any further filtering of the lines?? Some might argue that this would be ok in this particular scenario, but anyway...
***************
OnInit()
BufferTable."Code 1" := '1300';
BufferTable.Integer_1 := 1;
BufferTable.INSERT;
BufferTable."Code 1" := '1000';
BufferTable.Integer_1 := 2;
BufferTable.INSERT;
BufferTable."Code 1" := '1160';
BufferTable.Integer_1 := 3;
BufferTable.INSERT;
BufferTable."Code 1" := '1850';
BufferTable.Integer_1 := 4;
BufferTable.INSERT;
BufferTable.SETCURRENTKEY(Integer_1);
OnFindRecord(Which : Text) : Boolean
IF BufferTable.GET("No.") THEN;
IF NOT BufferTable.FIND(Which) THEN
EXIT(FALSE);
IF NOT GET(BufferTable."Code 1") THEN
EXIT(FALSE);
EXIT(TRUE);
OnNextRecord(Steps : Integer) : Integer
IF NOT BufferTable.GET("No.") THEN
EXIT(0);
CurrSteps := BufferTable.NEXT(Steps);
IF CurrSteps <> 0 THEN
IF NOT GET(BufferTable."Code 1") THEN
CurrSteps := 0;
EXIT(CurrSteps);
***************
The idea of the code is, that Machine No. '1300' is the Main Machine and therefore should be the Header-line in the page (and I could do some conditionalle formatting of the line). The code works ok: The Machine line is in fact in top of the page....But it's not possible to do any further filtering of the lines?? Some might argue that this would be ok in this particular scenario, but anyway...
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