I'm running my head against the wall here trying to update a salesorder in C# through AIF (Dynamics AX webservices)

I have the following code:

```
    /// <summary>
    /// Updates an order in AX
    /// </summary>
    /// <param name="order">Order to update</param>
    public void UpdateOrder(SalesOrder order)
    {
        try
        {
            var client = new write.SalesOrderServiceClient();
            var callContext = new write.CallContext() { Company = "mcompany" };
            var entityKeyList = new write.EntityKey[1];
            var entityKey = new write.EntityKey();
            var keyField = new write.KeyField();
            keyField.Field = "SalesId";
            keyField.Value = order.orderCaseId;                
            entityKey.KeyData = new write.KeyField[1] { keyField };
            entityKeyList = new write.EntityKey[1] { entityKey };

            var salesOrder = new write.AxdSalesOrder
            {
                DocPurpose = write.AxdEnum_XMLDocPurpose.Original,
                SalesTable = new write.AxdEntity_SalesTable[1],
            };

            salesOrder.SalesTable[0] = new write.AxdEntity_SalesTable
            {
                PurchOrderFormNum = order.purchaseOrderFormNumber,
                ReceiptDateRequested = order.receiptDateRequested,
                SalesLine =
                    new write.AxdEntity_SalesLine[order.salesOrderLines.Count()],
                _DocumentHash = order.documentHash
            };

            var orderLinesArray = order.salesOrderLines.ToArray();
            for (int i = 0; i < order.salesOrderLines.Count(); i++)
            {
                salesOrder.SalesTable[0].SalesLine[i] = new write.AxdEntity_SalesLine()
                {
                    SalesQty = orderLinesArray[i].quantity,
                    SalesUnit = orderLinesArray[i].unit,
                };
            }

            client.update(callContext, entityKeyList, salesOrder);
        }
        catch (Exception e)
        {
            Logging.AddLogEntry(e.Message);
        }
    }

```

The data for the AX order to be updated comes from my model object `SalesOrder` which I try to map to an AxdSalesOrder object to pass to the service.

I keep getting the following exception: 

```
The key field SalesId cannot be updated.

```

Does anyone know what I'm doing wrong here? :-)

Thanks in advance!