Forum Discussion

jitenderkumar's avatar
6 years ago
Solved

How to get Purchase Order with Orderlines using .Net SDK?

Hi,

 

I am using the AccountRight .Net SDK to retrieve various entities like Customers, Account, PurchaseOrder etc.

I am able to get the PurchaseOrder using the following code -

var service = new PurchaseOrderService(config);
var result = service.GetRange(file, null, credentials);

 

The result contains only the PurchaseOrder info, can't find any Line items under it. Could you please guide how to get the order lines using the API? Any example would be great.

 

Many thanks.

 

Kind regards,

JK

2 Replies

Replies have been turned off for this discussion
  • skihappy's avatar
    skihappy
    Experienced Cover User
    6 years ago

    Dim Pur1Svc = New Purchase.ServicePurchaseOrderService(myConfiguration, Nothing, _oAuthKeyService)

    Pur1Svc.GetRange(companyFile, null, credentials, OnServicePurchaseOrderLineComplete, OnError)

     

    returns all service purchase orders as a paged list (usually 1000 at a time) with lines (if you do not use filters)

     

    loopint = 0 to bills,items.count-1

    ...

    If Bills.Items(loopint).Lines.Count > 0 Then

    ...

    For lineitems = 0 To lvBills.Items(loopint).Lines.Count - 1

     ...   iterates through all PO line(s) in purchase order(s) 

Looking for something else?

Search the Community Forum for answers or find your topic and get the conversation started!

Community home

Level up your skills using MYOB software.

 

Find help guides and technical solutions for all MYOB products here

Explore video tutorials for our software at the MYOB Academy here

 

Dig into MYOB Academy for free courses, learning paths and live events to help build your business with MYOB.