When I want to update the balance in a Invoice, the code below is running normally without any error, but the balance doesn't change, why?
var queryService = new QueryService<Intuit.Ipp.Data.Invoice>(context);
IList<Intuit.Ipp.Data.Invoice> list = queryService.Where(p => true).ToList();
foreach (var invoice in list)
{
if (invoice.Id == order.Accounting.QBOID)
{
if (invoice.Balance != order.Accounting.SurveyAmount)
{
Invoice invo = new Invoice();
invo.Id = invoice.Id;
invo = commonService.FindById(invo);
invo.Balance = order.Accounting.SurveyAmount.HasValue ? order.Accounting.SurveyAmount.Value : 0;
invo.sparse = true;
commonService.Update(invo);
}
}
Balance is a read-only field in Invoice. It can't be updated.
Ref doc.
Add
Thanks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With