Failed in partial updating sales order

Asked By 30 points N/A Posted on -
qa-featured

Hello,

I tried to update an AIF sales order using an XML file but get the following error.
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>contosoAdministrator</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>
——————————————————————————
I have no idea why this is happening.  The precise line of error is 61 and I think this is 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);
——————————————————————————

Anybody knows what is going on? Thanks

SHARE
Answered By 0 points N/A #138023

Failed in partial updating sales order

qa-featured

The error can be due to several reasons. The thing that you have pasted here seems to be okay except for few things that depend on system to system. I am not sure if the exact solution will work or not but here are few things that you can try.

  1. First make sure that you break the code into separate segments or different parts.
  2. Now run the parts separately one at a time. This will exclude the chance of any piece of code going wrong.
  3. Keep going until you get an error in the segment of the code that is causing the whole program to crash.
  4. Either delete that part or modify it to see if the bug has been removed or not.

 

 

Login/Register to Answer

Related Questions