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

This thread is now closed to new comments.
Some of the links and information provided in this thread may no longer be available or relevant.
If you have a question please start a new post.
jitenderkumar
1 Post
User
Australia

1Posts

0Kudos

0Solutions

Solved: Go to Solution

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 2
Triboss
Valued Partner
99 Posts
Valued Partner
Valued Partner

99Posts

6Kudos

15Solutions

Accepted Solution Solved

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

You need to go "down" a level and use the Order Type eg. Item/Service/Pro.

This will then include the lines on the order.

See here for details:

https://developer.myob.com/api/accountright/v2/purchase/order/order_item/

skihappy
Experienced Partner
25 Posts
Experienced Partner
Australia
Experienced Partner

25Posts

3Kudos

0Solutions

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

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) 

Didn't find your answer here?

Try using advanced search to find a post more easily Advanced Search
or
Get the conversation started and make a new post Start a Post