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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How do I associate a new SalesOrder to a SalesAgreement?

(0) ShareShare
ReportReport
Posted on by

I'm developing an application which is integrated with Dynamics AX 2012 using the AIF. We use the Document Services to read, create and update SalesOrder in AX. Now I have a problem when I want to create a new SalesOrder connected to an existing SalesAgreement (I think this is called a Release Sales Order). What fields in the SalesOrder.xml document must I set to associate the new order with an existing Sales Agreement? And also the SalesLine to the matching Agreement line. Below is a sample of a SalesOrder I send now:

<?xml version="1.0" encoding="UTF-8"?>
<Envelope xmlns="schemas.microsoft.com/.../Message">
  <Header>
    <MessageId>{6AB0C52D-3F3D-4133-A242-879C782B7103}</MessageId>
    <Action>schemas.microsoft.com/.../create&lt;/Action>
  </Header>
  <Body>
    <MessageParts xmlns="schemas.microsoft.com/.../Message">
      <SalesOrder xmlns="schemas.microsoft.com/.../SalesOrder">
        <SalesTable class="entity">
          <ContactPersonId>033682_002</ContactPersonId>
          <CustAccount>P105622</CustAccount>
          <DlvMode>Hämtas</DlvMode>
          <DocumentStatus>None</DocumentStatus>
          <PurchOrderFormNum>PW_DUMMY</PurchOrderFormNum>
          <ReceiptDateRequested>2017-06-30</ReceiptDateRequested>
          <ShipCarrierDeliveryContact>nn 123</ShipCarrierDeliveryContact>
          <ShippingDateConfirmed>2017-06-28</ShippingDateConfirmed>
          <ShippingDateRequested>2017-06-30</ShippingDateRequested>
          <Agreement>5637156633</Agreement>
          <SalesLine class="entity">
            <DlvMode>Hämtas</DlvMode>
            <ItemId>71840A</ItemId>
            <SalesPrice>2.52</SalesPrice>
            <SalesQty>1000</SalesQty>
            <SalesUnit>st</SalesUnit>
            <ShippingDateConfirmed>2017-06-28</ShippingDateConfirmed>
            <ShippingDateRequested>2017-06-30</ShippingDateRequested>
            <InventDim class="entity">
              <InventColorId>Saleby G</InventColorId>
              <InventLocationId>Stakheden</InventLocationId>
              <InventSizeId>O</InventSizeId>
            </InventDim>
          </SalesLine>
        </SalesTable>
      </SalesOrder>
    </MessageParts>
  </Body>
</Envelope>

Best regards

/Valle

*This post is locked for comments

I have the same question (0)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 26

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans