Adding Comments to the Sales Order

I’m trying to include comments on our Sales Order.

Basically I’m using the Sales Order No. from the Sales Header table 36 and linking it to table 44 Sales Comment Line.

On the report the only comment showing up is the last comment from table 44.

Here is my code. Comments is the field I’m putting on the report. This is under the OnAfterGetRecord() trigger.

GsParentItemNo :=’’;

GsParentItemNo :=“No.”;

TempComments.SETRANGE(“No.”,GsParentItemNo) ;
IF TempComments.FIND(’-’) THEN
REPEAT

Comments :=TempComments.Comment

UNTIL TempComments.NEXT = 0;

Hi Greg,

The code is fine but the design is not correct. This code loops the table but is not doing anything with the information so it exits with the last record. Unless the comment table has it’s own dataitem it will always print the last record when it goes to print.

Greg,

are you working on report 205? If so you may try to add a dataitem from table 44.

If you want the comments printed before the order body, insert it before “Sales Line” dataitem, if you want them printed after the order body, insert it after “Sales Line”.

Indent the new dataitem at the same level as “Sales Line” and link it to “Sales Header” through Document Type and No.

Then add a body section for the new dataitem and add a control in it with SourceExpr=Comment

This might be a start [:D]

Anna the report I’m using is a copy of 205 with other Mods done to it. Mostly cosmetic with Logo and other minor things done to it.

I did what you asked I put the Sales Comment Line below the Sales Line with the same indent.

When I go to sections and add a new body for Sales Comment Line it puts it on the top of the report. For some reason the Insert Section - Before Current Selection and After Current Selection get greyed out and it won’t allow me to put it under the Sales Line Body where I want it…

Very strange…

Thanks for all your help. It did bring the Comments but not where I wanted them in the report.

Sorry, it was my mistake. Before current section and After current section only work when you are adding a new section to a dataitem which already has at least one. The order of sections of different dataitems is fixed by the dataitems sequence and level.

To print comments at the end of the document try to move the Sales Comment Line dataitem after RoundLoop and DimensionLoop2 - still indented as Sales Line and linked to Sales Header

I’ll give it a shot Anna.

Greg

It is working Anna.

I put Sales Comment Line on the bottom of the table order and indented it instead of keeping it at the same level as SalesLine table. It still references Sales Header for the field no. linking.

Greg