Retrieve first commentline

How do I retrieve the first commentline from a Sales Header comment ? I need to use the first commentline in rep 205 Sales Confirmation in the PageLoop Header (1) section. TIA Lars Jensen

If the header section runs, a record is even read. this record has filled primery key fields with the data of this fields you can do a GET() to commentline-table then you can printout the data. BUT perhaps you want to use a new Dataitem within the report ? THen data is printed as block below the header. Perhaps such a solution is a little bit nicer for you and your customer ?

But be aware to use same key and sorting like in Sales Header Comment Form! Otherwise you may get another line with GET()

Create the following Global Variables: Name DataType Subtype SalesCommentLine Record Sales Comment Line Put this code in OnAfterGetRecord of DataItem SalesHeader CLEAR(SalesCommentLine); SalesCommentLine.SETRANGE("Document Type","Document Type"); SalesCommentLine.SETRANGE("No.","No."); IF SalesCommentLine.FIND('-') THEN ; Now you can easily put a TextBox control on PageLoop Header Section with SourceExpr SalesCommentLine.Comment


Alternative solution: Create a FlowField (Text80) on Sales Header Table with a CalcFormula like: Lookup("Sales Comment Line".Comment WHERE (Document Type=FIELD(Document Type),No.=FIELD(No.))) Then you can also print this Field on the PageLoop Header Section

Thanks everyone Everything seems so easy when you know the answer [:)] /Lars