Skip to Content
author's profile photo Former Member
Former Member

Retreive Invoice Lines

Goals

1. Retreive Invoice

2. Invoice Lines

Problem I can only access one line but not the other.

Code:

IDocuments oDoc = (IDocuments) oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices);

oDoc.GetByKey(2);

IDocument_Lines lines = (IDocument_Lines)oDoc.Lines;

lines.Count==2 (this is true)

lines.Count is 2 but if I look at lines object it only shows me the current line.

How do I Iterate it over other lines.

Thank you

Regards

Imran

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 20, 2007 at 06:44 AM

    Hi Imran,

    once you get the invoice object you can iterate through the lines as shown below

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

    {

    oinv.Lines.SetCurrentLine(i);

    //and access the required data

    }

    Hope this helps

    Regards

    Vishnu

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.