Partner Zone

Error with trying to insert ItemInvoice Lines

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);
	}

 

 

 

3 REPLIES 3
al3
3 Posts
User
User

3Posts

0Kudos

0Solutions

Re: Error with trying to insert ItemInvoice Lines

 working again

Melisa_D
MYOB Moderator
9,875 Posts
MYOB Moderator
MYOB Moderator

9,875Posts

693Kudos

1,117Solutions

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  

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