Quantcast
Viewing all articles
Browse latest Browse all 73760

Error while updating multiple items through AIF

 Hi,

I am trying to update the Items in Dynamics AX using the AIF InventItemServices update operation. The update operation works fine for a single item but it fails when trying to update multiple items. This happens when I include the InventDimIds in the XML trying to update the DefaultOrder Settings (Managa Inventory Tab-> Default Order Settings tab) for the Item..

Here is the XML i am trying to post in the FileAdapter configured Inbound Port

<?xml version="1.0" encoding="utf-8"?>
<Envelope xmlns="http://schemas.microsoft.com/dynamics/2011/01/documents/Message"
          xmlns:xdt="http://www.w3.org/2005/02/xpath-datatypes">
  <Header>
    <Company>cahp</Company>
    <Action>http://schemas.microsoft.com/dynamics/2008/01/services/ItemService/update</Action>
  </Header>
  <Body>
    <MessageParts>
      <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>ItemId</Field>
              <Value>WRA20009</Value>
            </KeyField>
          </KeyData>
        </EntityKey>
        <EntityKey xmlns="http://schemas.microsoft.com/dynamics/2006/02/documents/EntityKey">
          <KeyData>
            <KeyField>
              <Field>ItemId</Field>
              <Value>WRA20010</Value>
            </KeyField>
          </KeyData>
        </EntityKey>       
      </EntityKeyList>
      <Item xmlns="http://schemas.microsoft.com/dynamics/2008/01/documents/Item">
        <DocPurpose>Original</DocPurpose>
        <SenderId>cahp</SenderId>
        <InventTable class="entity" action="update">
          <_DocumentHash>8bb52ccc65ec1144e5e5bc60d6713716</_DocumentHash>        
          <ItemId>WRA20009</ItemId>     

          <InventItemSalesSetup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                                xsi:type="AxdEntity_InventItemSalesSetup"
                                class="entity"
                                action="create">
            <ItemId>WRA20009</ItemId>
            <InventDimSalesSetup xsi:type="AxdEntity_InventDimSalesSetup" class="entity" action="create">
              <InventDimId>AllBlank</InventDimId>
            </InventDimSalesSetup>
            <DefaultInventDimSalesSetup xsi:type="AxdEntity_DefaultInventDimSalesSetup" class="entity" action="create">
              <InventDimId>AllBlank</InventDimId>
            </DefaultInventDimSalesSetup>
          </InventItemSalesSetup>
          <InventItemPurchSetup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                                xsi:type="AxdEntity_InventItemPurchSetup"
                                class="entity"
                                action="create">
            <CalendarDays>Yes</CalendarDays>
            <HighestQty>0.000000</HighestQty>
            <ItemId>WRA20009</ItemId>
            <LeadTime>25</LeadTime>
            <LowestQty>0.000000</LowestQty>
            <MultipleQty>0.000000</MultipleQty>
            <InventDimPurchSetup class="entity" action="create" xsi:type="AxdEntity_InventDimPurchSetup">
              <InventDimId>AllBlank</InventDimId>
            </InventDimPurchSetup>
            <DefaultInventDimPurchSetup xsi:type="AxdEntity_DefaultInventDimPurchSetup" class="entity" action="create">
              <InventDimId>AllBlank</InventDimId>
              <InventSiteId>1</InventSiteId>
            </DefaultInventDimPurchSetup>
          </InventItemPurchSetup>
          <InventItemInventSetup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                                 xsi:type="AxdEntity_InventItemInventSetup"
                                 class="entity"
                                 action="create">
            <ItemId>WRA20009</ItemId>
            <InventDimInventSetup xsi:type="AxdEntity_InventDimInventSetup" class="entity" action="create">
              <InventDimId>AllBlank</InventDimId>
            </InventDimInventSetup>
            <DefaultInventDimInventSetup xsi:type="AxdEntity_DefaultInventDimInventSetup" class="entity" action="create">
              <InventDimId>AllBlank</InventDimId>
            </DefaultInventDimInventSetup>
          </InventItemInventSetup>
        </InventTable>


        <InventTable class="entity" action="update">
          <_DocumentHash>ca2b09b42a906ea52bfa4d05bfb883c2</_DocumentHash>         
          <ItemId>WRA20010</ItemId>
          <InventItemSalesSetup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                                xsi:type="AxdEntity_InventItemSalesSetup"
                                class="entity"
                                action="create">
            <ItemId>WRA20010</ItemId>
            <InventDimSalesSetup xsi:type="AxdEntity_InventDimSalesSetup" class="entity" action="create">
              <InventDimId>AllBlank</InventDimId>
            </InventDimSalesSetup>
            <DefaultInventDimSalesSetup xsi:type="AxdEntity_DefaultInventDimSalesSetup" class="entity" action="create">
              <InventDimId>AllBlank</InventDimId>
            </DefaultInventDimSalesSetup>
          </InventItemSalesSetup>
          <InventItemPurchSetup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                                xsi:type="AxdEntity_InventItemPurchSetup"
                                class="entity"
                                action="create">
            <CalendarDays>Yes</CalendarDays>
            <HighestQty>0.000000</HighestQty>
            <ItemId>WRA20010</ItemId>
            <LeadTime>25</LeadTime>
            <LowestQty>0.000000</LowestQty>
            <MultipleQty>0.000000</MultipleQty>
            <InventDimPurchSetup class="entity" action="create" xsi:type="AxdEntity_InventDimPurchSetup">
              <InventDimId>AllBlank</InventDimId>
            </InventDimPurchSetup>
            <DefaultInventDimPurchSetup xsi:type="AxdEntity_DefaultInventDimPurchSetup" class="entity" action="create">
              <InventDimId>AllBlank</InventDimId>
              <InventSiteId>1</InventSiteId>
            </DefaultInventDimPurchSetup>
          </InventItemPurchSetup>
          <InventItemInventSetup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                                 xsi:type="AxdEntity_InventItemInventSetup"
                                 class="entity"
                                 action="create">
            <ItemId>WRA20010</ItemId>
            <InventDimInventSetup xsi:type="AxdEntity_InventDimInventSetup" class="entity" action="create">
              <InventDimId>AllBlank</InventDimId>
            </InventDimInventSetup>
            <DefaultInventDimInventSetup xsi:type="AxdEntity_DefaultInventDimInventSetup" class="entity" action="create">
              <InventDimId>AllBlank</InventDimId>
            </DefaultInventDimInventSetup>
          </InventItemInventSetup>
          </InventItemPrice>
        </InventTable>      
      </Item>
      </MessageParts>
  </Body>
</Envelope>

The error when this XML is posted in the inbound port is:

Exception type Module Subsystem Exception message Port name
Error AIF Line=1, Pos=4417, Xpath=/Item/InventTable[2]/InventItemInventSetup[1] Error found when validating record. ItemMasterUpdate
Warning AIF Field 'Dimension No.' must be filled in. ItemMasterUpdate
Error AIF Line=1, Pos=4417, Xpath=/Item/InventTable[2]/InventItemInventSetup[1] Error found when validating record. ItemMasterUpdate
Warning AIF Field 'Dimension No.' must be filled in. ItemMasterUpdate
Error AIF Line=1, Pos=3715, Xpath=/Item/InventTable[2]/InventItemPurchSetup[1] Error found when validating record. ItemMasterUpdate
Warning AIF Field 'Dimension No.' must be filled in. ItemMasterUpdate
Error AIF Line=1, Pos=3715, Xpath=/Item/InventTable[2]/InventItemPurchSetup[1] Error found when validating record. ItemMasterUpdate
Warning AIF Field 'Dimension No.' must be filled in. ItemMasterUpdate
Error AIF Line=1, Pos=3373, Xpath=/Item/InventTable[2]/InventItemSalesSetup[1] Error found when validating record. ItemMasterUpdate
Warning AIF Field 'Dimension No.' must be filled in. ItemMasterUpdate
Error AIF Line=1, Pos=3373, Xpath=/Item/InventTable[2]/InventItemSalesSetup[1] Error found when validating record. ItemMasterUpdate

The Service throws error for each of the InventDimId provided in the XML. Any help with this is greatly appreciated.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


Viewing all articles
Browse latest Browse all 73760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>