Skip to content
Developerhome
X3

Example of importing in real time with data errors

  Less than to read

This example demonstrates the import of two customers into Sage X3. The first customer has two errors: the value for BCGCOD is invalid and the value for BPCPYR is missing. The second customer has no errors.


The data for the file-based import would look like this:

B;FRX;OX100;Paris Cycle;UrbanCycle;SA;001;001;001;001;EUR;49120544900011;349;FR22491205449;FR001;FRA;CH30NETEOM;LOCAL;700;700;610000;1;FR251;;;;;
A;001;Paris Cycle;35, Chaussée de la Madeleine;;;44000;NANTES;FR;251899270;251899278;2;
A;002;U.C. Dépot;2 Boulevard Arcole;;;31000;TOULOUSE;FR;066581312;;1;
D;001;Paris Cycle;FR251;3;FR201;EXW;2;;;;
R;FR;30004480581456789012313;BNP Paribas
B;FR;OX10;Paris Cycle;ParisCycle;SA;001;001;001;001;EUR;49120544900011;349;FR22491205449;FR001;FRA;CH30NETEOM;LOCAL;700;700;610000;1;FR251;;;;;
A;001;Paris Cycle;35, Chaussée de la Madeleine;;;44000;NANTES;FR;251899270;251899278;2;
A;002;U.C. Dépot;2 Boulevard Arcole;;;31000;TOULOUSE;FR;066581312;;1
D;001;Paris Cycle;FR251;3;FR201;EXW;2;;;;
R;FR;30004480581456789012313;BNP Paribas

SOAP Request

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wss="http://www.adonix.com/WSS">
  <soapenv:Header/>
  <soapenv:Body>
    <wss:run soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <callContext xsi:type="wss:CAdxCallContext">
        <codeLang xsi:type="xsd:string">ENG</codeLang>
        <poolAlias xsi:type="xsd:string">IMPORT-EXPORT</poolAlias>
        <poolId xsi:type="xsd:string"></poolId>
        <requestConfig xsi:type="xsd:string">
          <![CDATA[adxwss.optreturn=JSON&adxwss.beautify=true&adxwss.trace.on=off]]>
        </requestConfig>
      </callContext>
      <publicName xsi:type="xsd:string">AOWSIMPORT</publicName>    /** AOWSIMPORT = web service name **/
      <inputXml xsi:type="xsd:string">
        <![CDATA[{
          "GRP1": {
            "I_MODIMP": "BPC",       /** import template **/
            "I_AOWSTA": "NO",        /** do not use temp storage space **/
            "I_EXEC": "REALTIME",    /** execute the import immediately **/
            "I_RECORDSEP": "|",      /** record separator **/
            "I_FILE":"B;FRX;OX100;Paris Cycle;UrbanCycle;SA;001;001;001;001;EUR;49120544900011;349;FR22491205449;FR001;FRA;CH30NETEOM;LOCAL;700;700;610000;1;FR251;;;;;|A;001;Paris Cycle;35, Chaussée de la Madeleine;;;44000;NANTES;FR;251899270;251899278;2;|A;002;U.C. Dépot;2 Boulevard Arcole;;;31000;TOULOUSE;FR;066581312;;1;|D;001;Paris Cycle;FR251;3;FR201;EXW;2;;;;|R;FR;30004480581456789012313;BNP Paribas|B;FR;OX10;Paris Cycle;ParisCycle;SA;001;001;001;001;EUR;49120544900011;349;FR22491205449;FR001;FRA;CH30NETEOM;LOCAL;700;700;610000;1;FR251;;;;;|A;001;Paris Cycle;35, Chaussée de la Madeleine;;;44000;NANTES;FR;251899270;251899278;2;|A;002;U.C. Dépot;2 Boulevard Arcole;;;31000;TOULOUSE;FR;066581312;;1|D;001;Paris Cycle;FR251;3;FR201;EXW;2;;;;|R;FR;30004480581456789012313;BNP Paribas|END"
          }
        }]]>
      </inputXml>
    </wss:run>
  </soapenv:Body>
</soapenv:Envelope>

SOAP Response

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wss="http://www.adonix.com/WSS">
  <soapenv:Body>
    <runResponse>
      <runReturn xsi:type="wss:CAdxResultXml">
        <resultXml xsi:type="xsd:string" xsi:nil="true"/>
        <messages xsi:type="soapenc:Array" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" soapenc:arrayType="wss:CAdxMessage[3]">
          <messages href="#id0"/>
          <messages href="#id1"/>
          <messages href="#id2"/>
        </messages>
        <status xsi:type="xsd:int">0</status>    /** 0 = Error - This call failed because of the errors below. This means the input variables are not returned. **/
        <technicalInfos xsi:type="wss:CAdxTechnicalInfos">
          <busy xsi:type="xsd:boolean">false</busy>
          <changeLanguage xsi:type="xsd:boolean">false</changeLanguage>
          <changeUserId xsi:type="xsd:boolean">false</changeUserId>
          <flushAdx xsi:type="xsd:boolean">false</flushAdx>
          <loadWebsDuration xsi:type="xsd:double">159</loadWebsDuration>
          <nbDistributionCycle xsi:type="xsd:int">-1</nbDistributionCycle>
          <poolDistribDuration xsi:type="xsd:double">1</poolDistribDuration>
          <poolEntryIdx xsi:type="xsd:int">4392</poolEntryIdx>
          <poolExecDuration xsi:type="xsd:double">11512</poolExecDuration>
          <poolRequestDuration xsi:type="xsd:double">-1</poolRequestDuration>
          <poolWaitDuration xsi:type="xsd:double">77</poolWaitDuration>
          <processReport xsi:type="xsd:string" xsi:nil="true"/>
          <processReportSize xsi:type="xsd:int">-1</processReportSize>
          <reloadWebs xsi:type="xsd:boolean">false</reloadWebs>
          <resumitAfterDBOpen xsi:type="xsd:boolean">false</resumitAfterDBOpen>
          <rowInDistribStack xsi:type="xsd:int" xsi:nil="true"/>
          <totalDuration xsi:type="xsd:double">11829</totalDuration>
          <traceRequest xsi:type="xsd:string"/>
          <traceRequestSize xsi:type="xsd:int">0</traceRequestSize>
        </technicalInfos>
      </runReturn>
    </runResponse>
    <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="wss:CAdxMessage">
      <type>3</type>    /** The first two types are 3, for error, and the messages are errors from customer OL100, as indicated in each message. **/
      <message>Field BCGCOD : Customer category : FRX Record does not exist &lt;OX100></message>    /** (&lt; is used in place of < in order to preserve proper XML formatting) **/
    </multiRef>
    <multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="wss:CAdxMessage">
      <type>3</type>
      <message>Field BPCPYR : Mandatory Field <OX100></message>
    </multiRef>
    <multiRef id="id2" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="wss:CAdxMessage">
      <type>1</type>    /** The third type and message indicate the successful import of customer OL10. **/
      <message>|Creation of OX10</message>
    </multiRef>
  </soapenv:Body>
</soapenv:Envelope>