MYOBCommunity
Partner Zone
|
|
Partner Zone

Updating Sales Order

2 REPLIES
Contributing Partner Kais
9 Posts
Contributing Partner
Kais
Contributing Partner

9Posts

0Kudos

1Solutions

Accepted Solution Solved Solution

Re: Updating Sales Order

Should have read the error codes guide carefully. I had to submit subtotal and total fields.

Contributing Partner Kais
9 Posts
Contributing Partner
Kais
Contributing Partner

9Posts

0Kudos

1Solutions

Re: Updating Sales Order

It's seems that something's wrong with JSON being submitted. Can't assign the .ShipQuantity field a decimal value 

Highlighted
Contributing Partner Kais
9 Posts
Contributing Partner
Kais
Contributing Partner

9Posts

0Kudos

1Solutions

Solved: Go to Solution

Updating Sales Order

Hi I'm trying to update a Sales Order record on .Net Core web application via UpdateAsync method and getting 400 error.

 

Here's the code:

public async Task SaveMyobOrder(MyobOrder myobOrder, Guid fileId)
{
var companyFile = await MyobCompanyFile(fileId);
var orderSvc = new ItemOrderService(_configurationCloud, null, _oAuthKeyService);

var order = await orderSvc.GetAsync(companyFile, myobOrder.UID, _credentials);

order.UID = myobOrder.UID;
order.Date = myobOrder.Date;
order.CustomerPurchaseOrderNumber = myobOrder.CustomerPurchaseOrderNumber;
order.ShipToAddress = myobOrder.ShipToAddress;
order.Comment = myobOrder.Comment;
order.PromisedDate = myobOrder.PromisedDate;

foreach (var item in order.Lines)
{
var orderItem = myobOrder.Lines.SingleOrDefault(l => l.RowID == item.RowID);
item.ShipQuantity = orderItem.ShipQuantity;

}

await orderSvc.UpdateAsync(companyFile, order, _credentials);

}

 

The problem appears when changing one of the "Lines'" item value. Might it be related to RowVersion in "Lines"?

 

Thanks.

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