Skip to Content
author's profile photo
Former Member

displaying documentLines

hi, i need sample to display lines of an order...My code doesn't work:

for (i=1;i<oOrder.Lines.Count;i++)

{

try

{

Console.Out.WriteLine("ItemCode:"oOrder.Lines.ItemCode"LineNum:"+oOrder.Lines.LineNum

"DocEntry"oOrder.DocEntry"Quantity:"oOrder.Lines.Quantity);

}

catch(Exception e)

{

Console.Out.WriteLine(e);

}

When i do this i got always the same line with a lineNum=0;

I think im going in the wrong way, somebody has an exemple to show me??

Thank you...

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    author's profile photo
    Former Member
    Posted on Feb 28, 2005 at 02:16 PM

    You will need to call setcurrentline before doing anything, because the lines object is not exposed as a collection, and therefore has no direct indexer parameter.

    or (i=1;i<oOrder.Lines.Count;i++)

    {

    try

    {

    // Set the current order line

    oOrder.Lines.SetCurrentLine(i - 1);

    Console.Out.WriteLine("ItemCode:"oOrder.Lines.ItemCode"LineNum:"+oOrder.Lines.LineNum

    "DocEntry"oOrder.DocEntry"Quantity:"oOrder.Lines.Quantity);

    }

    catch(Exception e)

    {

    Console.Out.WriteLine(e);

    }

    Add comment
    10|10000 characters needed characters exceeded