web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

XML document error in SalesOrder AIF

(0) ShareShare
ReportReport
Posted on by

I m taking a CSV file and converting it to an XML that can then be imported via the sales order inbound port.  The port is set up with the SalesSalesorder read, create etc and the data policies are standard.  The xml file I create and the example from the MS customer source showing what the XML should look like look the same to me but I am getting an error processing the XML around the Salesline tag.  I have stared at this for ages and cannot see where I have stuffed up.  A fresh set of eyes may see it.

The error detail in the AIF processing exceptions is:-
Invalid document schema. The following error was returned:  The element 'SalesTable' in namespace 'http://schemas.microsoft.com/dynamics/2008/01/documents/SalesOrder' has invalid child element 'SalesLine' in namespace 'http://schemas.microsoft.com/dynamics/2008/01/documents/SalesOrder'. List of possible elements expected: 'QuotationId, ReceiptDateConfirmed, ReceiptDateRequested' in namespace 'http://schemas.microsoft.com/dynamics/2008/01/documents/SalesOrder'.
 
The file I have created looks like :-
 
<?xml version="1.0" encoding="utf-8"?>
<Envelope xmlns="schemas.microsoft.com/.../Message">
  <Header>
    <MessageId>{86A4C9FA-EDCA-4532-88CF-DE2A47F9901C}</MessageId>
    <Company>PTNZ</Company>
    <Action>schemas.microsoft.com/.../create&lt;/Action>
  </Header>
  <Body>
    <MessageParts xmlns="schemas.microsoft.com/.../Message">
      <SalesOrder xmlns="schemas.microsoft.com/.../SalesOrder">
        <DocPurpose>Original</DocPurpose>
        <SalesTable class="entity">
          <CurrencyCode>NZD</CurrencyCode>
          <CustAccount>FLY001</CustAccount>
          <DeliveryDate>2015-10-19</DeliveryDate>
          <DeliveryName>Mrs Mary-Ellen </DeliveryName>
          <InvoiceAccount>FLY001</InvoiceAccount>
          <Payment>20TH</Payment>
          <PurchOrderFormNum>PTED00000410233</PurchOrderFormNum>
          <SalesLine class="entity">
            <ItemId>Poppy</ItemId>
            <QtyOrdered>1.00</QtyOrdered>
            <SalesQty>1.00</SalesQty>
            <SalesUnit>EA</SalesUnit>
            <InventDim class="entity">
              <configId>V1</configId>
              <InventColorId>8</InventColorId>
              <InventLocationId>NZ</InventLocationId>
              <InventSiteId>NZ</InventSiteId>
              <InventSizeId />
            </InventDim>
          </SalesLine>
        </SalesTable>
      </SalesOrder>
    </MessageParts>
  </Body>
</Envelope>
 
The MS example is found at

https://msdn.microsoft.com/EN-US/library/aa633136.aspx and looks like

 <?xml version="1.0" encoding="utf-8"?>
<Envelope xmlns = "http://schemas.microsoft.com/
dynamics/2011/01/documents/Message">
<Header>
  <MessageId>{D1F93462-0229-1430
    -0001-93FAE32B2E4D}</MessageId>
  <Action>http://schemas.microsoft.com/
    dynamics/2008/01/services/
    SalesOrderService/create</Action>
</Header>

<Body>
  <MessageParts xmlns = "http://schemas.microsoft.com/
    dynamics/2011/01/documents/Message">
   <SalesOrder xmlns = "http://schemas.microsoft.com/
     dynamics/2008/01/documents/SalesOrder">
    <DocPurpose>Original</DocPurpose>

    <SalesTable class = "entity">
     <CurrencyCode>EUR</CurrencyCode>
     <CustAccount>4000</CustAccount>
     <DeliveryDate>2008-02-29</DeliveryDate>
     <ExportReason>Sale parts.</ExportReason>
     <Payment>D30</Payment>
     <PurchOrderFormNum>PO2</PurchOrderFormNum>

     <SalesLine class = "entity">
      <ItemId>ESB-009</ItemId>
      <SalesQty>1.00</SalesQty>
      <SalesUnit>Pcs</SalesUnit>
     </SalesLine>
    </SalesTable>
   </SalesOrder>

  </MessageParts>
</Body>
</Envelope>

Many thanks
Paulina
 

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    237,855 Most Valuable Professional on at

    It means that the elements (such as QuotationId) are mandatory for your service (at field level, document level or in data policies). You have to provide some values for them or to change configuration in AX.

  • Community Member Profile Picture
    on at

    Many thanks once again.

    Paulina

  • Community Member Profile Picture
    on at

    I am facing a similar issue, see below:

    This issue is thrown on the AX side when trying an integration from CRM to AX using Scribe Insight.

    Invalid document schema. The following error was returned:  The element 'SalesTable' in namespace 'schemas.microsoft.com/.../SalesOrder' has invalid child element 'InvoiceAccount' in namespace 'schemas.microsoft.com/.../SalesOrder'. List of possible elements expected: 'IntrastatAddValue_LV, IntrastatFulfillmentDate_HU, InventLocationId' in namespace 'schemas.microsoft.com/.../SalesOrder'.

    I will check if IntrastatAddValue_LV, IntrastatFulfillmentDate_HU or InventLocationId are mandatory fields.

    Will try out the solution tomorrow and see what is the outcome.

    Regards,
    Payal

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans