We recently installed rollup 13 to our Dynamics CRM local installation (we were previously on 7) and it's caused some unpredictable behaviour in our (ADX Studio) web portal.
Some code that executed reliabliy before now creates an exception.
On successful payment for products we run the following code to convert an order into an invoice
ColumnSet invoiceColumns = new ColumnSet("invoiceid", "totalamount");
var convertOrderRequest =
new ConvertSalesOrderToInvoiceRequest()
{
SalesOrderId = orderId,
ColumnSet = invoiceColumns
};
var convertOrderResponse =
(ConvertSalesOrderToInvoiceResponse)xrmServiceContext.Execute(convertOrderRequest);
This worked previosuly but now it throws an exception:
"the product and the unit cannot be updated while the entity is locked"
The problem is the order is not locked, and its pricing is not locked. I can go to the record in CRM and happily add new salesorderdetail records or change existing data. The order record is not price locked or closed and those buttons are still activated in the ribbon.
This is exactly the same code that we ran previously on CRM update 7 without any problems, but now it will not run at all without throwing this exception.
Is there something we need to change in the code to get this working again?
Thanks!