Error with trying to insert ItemInvoice Lines

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.
al3
3 Posts
User
User

3Posts

0Kudos

0Solutions

Error with trying to insert ItemInvoice Lines

I am getting the following error "A request should not contain UID during POST operation"

 

This is after I created an Item Invoice Header and then try and add Item Lines to the Invoice Header. This has worked for over 3 years. After I got the error I updated all the NuGet packages etc and still get the error. It is written in c# 4.5. Here is the code cut-down version of the code

 

ItemInvoice invoice = new ItemInvoice();
List<ItemInvoiceLine> lines = new List<ItemInvoiceLine>();
CustomerLink customer = new CustomerLink();
customer.UID = customerUID;
invoice.Customer = customer;
invoice.Date = Date;
invoice.IsTaxInclusive = false;
invoice.CustomerPurchaseOrderNumber =  PurchaseOrder ;
invoice.InvoiceDeliveryStatus = DocumentAction.Email;

// Create Invoice Header 

invoice =   ws.insertItemInvoice(invoice);


// Add Invoice Lines to Invoice

foreach (var orderline in orderLines)
       {
		ItemInvoiceLine line = new  ItemInvoiceLine();
            ItemLink item = new ItemLink();
            item.UID = orderline.ItemUID;
            line.Item = item;
            line.Description= orderline.Description;
            line.ShipQuantity = (decimal)orderline.Quantity;
            line.UnitPrice = (decimal)orderline.SellingPrice;
            TaxCodeLink taxCode = new TaxCodeLink();
            taxCode.UID = TaxUID;
            line.TaxCode = taxCode;
            lines.Add(line);
            orderline.SaleUID = invoice.UID; 
            invoice.Lines = lines; 
		var itemInvoiceSvc = new ItemInvoiceService(_configurationCloud, null, _oAuthKeyService);
		itemInvoiceSvc.InsertEx(companyFile, invoice, credentials);
	}

 

 

 

4 REPLIES 4
al3
3 Posts
User
User

3Posts

0Kudos

0Solutions

Re: Error with trying to insert ItemInvoice Lines

 working again

Melisa_D
10,735 Posts
Former Staff
Former Staff

10,735Posts

0Kudos

1,186Solutions

Re: Error with trying to insert ItemInvoice Lines

Hi @al3

 

Thanks for the update. Glad to hear that it is working again! 

 

Feel free to come back to the Community Forum in future if you have anymore questions, we are more than happy to assist.

Cheers,
Melisa

MYOB Community Support

Online Help| Forum Search| my.MYOB| Download Page

Did my answer help?

Mark it as a SolutionHelpful? Leave a to tell others

al3
3 Posts
User
User

3Posts

0Kudos

0Solutions

Re: Error with trying to insert ItemInvoice Lines

Hi 

The error is back 

 

ErrorError.NameError.MessageError.AdditionalDetailsError.ErrorCodeError.SeverityError.LearnMore
MYOB.AccountRight.SDK.ErrorUidInPostBodyA request should not contain UID during POST operation 173Error  
ljupcomanev
Contributing Partner
9 Posts
Contributing Partner
Australia
Contributing Partner

9Posts

0Kudos

0Solutions

Re: Error with trying to insert ItemInvoice Lines

Can you offer a solution.

 

I'm getting same issues with little help.

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