gtComments.RESET; gtComments.SETRANGE(gtComments."Table Name",gtComments."Table Name"::Customer); gtComments.SETRANGE(gtComments."No.","No."); IF gtComments.FINDLAST THEN IF gtComments.Date = 0D THEN BEGIN REPEAT gtComments.NEXT(-1); UNTIL gtComments.Date <> 0D; REPEAT Comments := Comments + ''+gtComments.Comment; UNTIL gtComments.NEXT = 0; END ELSE Comments := gtComments.Comment;
Answers
In your code, you are misusing the FINDLAST - it is used to getting the last record when you are not planning to go through the rest. Better will be to use FIND('+') in this case...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Suppose for a particular customer we have several comments, but because Comment Coloumn has Text limit so what the user do it comes to the next line and insert there without putting the Date.
So suppose for a customer i have 100 lines of comments and 97th line only has the date and comments. the 98th , 99th and 100th lines have only comments but no date because it is in continuation with 97th.
So my objective is to get the last line with date as the first line of the comment to print + all the following lines without Dates.
Ex. Comment Line Table
Date .................................. Line No................................... Comments
22/12/03 ........................... 100000 ................................... Testing Comments
...................................... 200000 ................................... Another Testing Comments...
25/12/04........................... 100000 ................................... New Comments, too short to place full
...................................... 200000 ................................... Comments here, thats why i have 3
...................................... 300000 ................................... Lines. thank you.
Now what i want on Report is New Comments, too short to place full Comments here, thats why i have 3 Lines. thank you.
Thanks a lot Kine.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.