problems with findset

kanikakanika Member Posts: 247
Hi experts!!

I need to print the comment line for each sales line (quotes).

I got a funtion: funcion1() : Text[250]
with a variable: Variable1, record, sales comment line

Variable1.SETRANGE("Document Type","Sales Line"."Document Type");
Variable1.SETRANGE("No.","Sales Line"."Document No.");
Variable1.SETRANGE("Document Line No.","Sales Line"."Line No.");
IF Variable1.FINDSET THEN BEGIN
REPEAT
EXIT(Variable1.Comment);
UNTIL Variable1.NEXT = 0;
END;

In the report I have a textbox (in roundloop, body section) where SourceExpr=funcion1

But I get only the first line of comments

Please help me, thanks!!!

Answers

  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    You exit your function by the EXIT statement. So, for sure it will only return the first Comment.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • kanikakanika Member Posts: 247
    trahk you but then.......wich statement I must use???
  • vaprogvaprog Member Posts: 1,141
    Hi kanika

    try to process your code in your head or step through it using the debugger

    Then also try to understand the workings of a report: What is a dataitem, what a section, what a control. What is their function/purpose.

    And just to give you some hints: Your code does not make sense. But even if it did, it would not benefit you because your approach is bound to fail.
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    Depends on how your report should look like. Maybe you can add another DataItem of Sales Comment Line.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
Sign In or Register to comment.