Failed in partial updating sales order

This question has suggested answer(s)

I can't update sales order by AIF using the following XML file.
Message says that "Cannot update record - the record does not exist.".
And this message is @SYS112449.
--------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8" ?>
 <Envelope xmlns="http://schemas.microsoft.com/dynamics/2008/01/documents/Message">
 <Header>
  <MessageId />
  <SourceEndpointUser>contoso\Administrator</SourceEndpointUser>
  <SourceEndpoint>FileAdapter</SourceEndpoint>
  <DestinationEndpoint>LocalEP</DestinationEndpoint>
  <Action>http://schemas.microsoft.com/dynamics/2008/01/services/SalesOrderService/update</Action>
  <ConversationId />
  </Header>
 <Body>
     <MessageParts xmlns="http://schemas.microsoft.com/dynamics/2008/01/documents/Message">
     <EntityKeyList xmlns="http://schemas.microsoft.com/dynamics/2006/02/documents/EntityKeyList">
         <EntityKey xmlns="http://schemas.microsoft.com/dynamics/2006/02/documents/EntityKey">
             <KeyData>
                 <KeyField>
                      <Field>SalesId</Field>
                      <Value>SO-101253</Value>
                  </KeyField>
              </KeyData>
          </EntityKey>
      </EntityKeyList>
  <SalesOrder xmlns="http://schemas.microsoft.com/dynamics/2008/01/documents/SalesOrder">
      <SalesTable class="entity" action="update">
         <_DocumentHash>5c6d97a737419b29e23c69a70765fba0</_DocumentHash>
         <DeliveryDate>2012-04-29</DeliveryDate>
         <PurchOrderFormNum>1</PurchOrderFormNum>
        <SalesLine class="entity" action="update">
             <ItemId>1001</ItemId >
             <SalesQty>5</SalesQty>
             <SalesUnit>ea</SalesUnit>
        </SalesLine>     
      </SalesTable>
    </SalesOrder>
  </MessageParts>
  </Body>
  </Envelope>
-----------------------------------------------------------------------------
Although the document read by AIF is as following.
------------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<Envelope xmlns="http://schemas.microsoft.com/dynamics/2008/01/documents/Message">
 <Header><MessageId>{E6D579B1-1C3F-40D5-858B-255CB17F83A4}</MessageId>
 <SourceEndpoint>LocalEP</SourceEndpoint><DestinationEndpoint>FileAdapter</DestinationEndpoint>
 <Action>http://schemas.microsoft.com/dynamics/2008/01/services/SalesOrderService/read</Action>
 <RequestMessageId>{A5BF71EF-100F-4DA2-B342-A65DD51C08C3}</RequestMessageId>
 </Header>
  <Body><MessageParts xmlns="http://schemas.microsoft.com/dynamics/2008/01/documents/Message">
   <SalesOrder xmlns="http://schemas.microsoft.com/dynamics/2008/01/documents/SalesOrder">
    <SalesTable class="entity">
     <_DocumentHash>5c6d97a737419b29e23c69a70765fba0</_DocumentHash>
     <DeliveryDate>2012-04-27</DeliveryDate><PurchOrderFormNum />
     <SalesLine class="entity">
      <ItemId>1003</ItemId><SalesQty>1.00</SalesQty><SalesUnit>ea</SalesUnit>
     </SalesLine>
     <SalesLine class="entity">
      <ItemId>1001</ItemId><SalesQty>1.00</SalesQty><SalesUnit>ea</SalesUnit>
     </SalesLine>
    </SalesTable>
   </SalesOrder>
  </MessageParts>
 </Body>
</Envelope>
------------------------------------------------------------------------------
Therefore I can't imagine the reason of the above error . This error ocuurs in the deserializeSubEntitiy method of the AxdBase class.Actual line of error occurs at 61 and this caused by the empty result of the following command.
I checked the _dataSourceName then found that it is "SalesLine".

------------------------------------------------------------------------------
// Find the corresponding existing record
        entityEntry = this.findEntityOnCurLevel(_dataSourceName,_axInternalBase);
------------------------------------------------------------------------------

Does anyone have any idea of solving this problem.

All Replies
  • Hi there,

    Did you find a solution to your problem?

    We are having the exact same problem to update the vendtable and it's corresponding address. When we remove the address element the vendor (VendTable) is updated without errors. However with the Address element we get the "Cannot update record - the record does not exist." error. Is it a problem of linking the address (child node) with the vendor (parent node)?

  • Hi,

    I couldn't find a solution not yet.

    My case is SalesOrder(parent) and SalesLine(child) then this is similar as your case.

  • Hi,

    I found the solution by adding the RecId and RecVersion in the child elements. Read this page for more details: blogs.msdn.com/.../rec-fields-required-in-aif-partial-update.aspx.

  • Hi,

    Thanks.

    I tried by using RecID and RecVersion then the above error disapered.

    Still I couldn't update with error message "Update has been cancelled".

  • I'm getting the same issue with a custom service.  I'm trying to do what this describes:

    technet.microsoft.com/.../hh582243.aspx

    Where you are supposedly able to do Create, Update, and Delete operations on child records but, it doesn't seem to work as advertised.  I've tried the RecId and RecVersion but, that doesn't work.