Return multiple text lines into report

aredmond@thompsonpump.com
Member Posts: 16
I am trying to use the "FIND" command to retrieve multiple comment lines, but I can only seem to get the first record:
CLEAR(Comment_Line);
Comment_Line.SETFILTER("No.", "Service Shipment Header"."Order No.");
Comment_Line.SETRANGE(Type,2);
IF Comment_Line.FIND('-') THEN BEGIN
Fault_1 := Comment_Line.Comment;
REPEAT
UNTIL Comment_Line.NEXT = 0;
END;
Is this the wrong use of the command, or am I misssing something?
As always, thank you for at least reading this.
Krakmup
CLEAR(Comment_Line);
Comment_Line.SETFILTER("No.", "Service Shipment Header"."Order No.");
Comment_Line.SETRANGE(Type,2);
IF Comment_Line.FIND('-') THEN BEGIN
Fault_1 := Comment_Line.Comment;
REPEAT
UNTIL Comment_Line.NEXT = 0;
END;
Is this the wrong use of the command, or am I misssing something?
As always, thank you for at least reading this.
Krakmup
0
Answers
-
Find('-') should give you a set where as FINDFIRST will only get you the single record.
Try FINDSET instead to guarantee based on your version of NAV that it's working. But i'd guess your filters are bad.
Try settings the filters directly on the NAV table as well if you are confused.0 -
Comment_Line.RESET;
Comment_Line.SETFILTER("No.", "Service Shipment Header"."Order No.");
Comment_Line.SETRANGE(Type,Comment_Line.Type::"2");
IF Comment_Line.FIND('-') THEN BEGIN
REPEAT
IF Fault_1 = '' THEN
Fault_1 := Comment_Line.Comment
ELSE
Fault_1 += Fault_1 + ' ' + Comment_Line.Comment;
UNTIL Comment_Line.NEXT = 0;
END;0 -
manthonylugo wrote: »...
IF Comment_Line.FIND('-') THEN BEGIN
REPEAT
IF Fault_1 = '' THEN
Fault_1 := Comment_Line.Comment
ELSE
Fault_1 += Fault_1 + ' ' + Comment_Line.Comment;
UNTIL Comment_Line.NEXT = 0;
END;
I think (of course we are all just guessing) that what is needed is:WITH Comment_Line DO BEGIN RESET; SETRANGE("No.", "Service Shipment Header"."Order No."); SETRANGE(Type,Type::"2"); IF FINDSET THEN BEGIN i := 1; REPEAT Fault[i] := Comment i += 1; UNTIL (NEXT = 0) or (i >= ARRAYLEN(Fault)); END;
David Singleton0
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