Example: Requesting Data from an External Financial Application

Use this example when requesting data from an external financial application.

In the ERP

In the External Financial Interface Data Request Utility, if the Unit Code 1 field is selected, the ExtFinRequestUnitCd1 task is submitted. This task builds an XML request document similar to this:

<IDORequest>

 <RequestHeader Type="LoadCollection">

  <RequestData>

   <LoadCollection Name= EXTFIN.ExtFinRequestUnitCd1.unitcd1>

style="clear: none;" />

    <Items>

     <Item ID="unitcd1">

     <Property>unit1</Property>

style="clear: none;" />

     <Property>description</Property>

style="clear: none;" />

     <Property>CreatedBy</Property>

style="clear: none;" />

     <Property>UpdatedBy</Property>

style="clear: none;" />

     </Item>

    </Items>

   </LoadCollection>

  </RequestData>

 </RequestHeader>

</IDORequest>

The XML document is passed to the external financial system as described in Updating SyteLine Data from Data in an External Financial Application.

In the External Financial System

An ASP page on that system should be set up to:

  • Retrieve the XML request document that was sent by SyteLine.
  • Know that the "LoadCollection" XML request it received wants to get data from the external financial application and return it to SyteLine.
  • Extract information about the table and columns requested from the XML (table (view) unitcd1; table columns unit1, description, CreatedBy, and UpdatedBy).
  • Map that data to the corresponding data in the external financial application:
    Table.Column ExtFin Table.Column
    unitcd1.unit1 ucode1.code
    unitcd1.description ucode1.description
    (See the note at the end of this section about how to handle the columns CreatedBy and UpdatedBy.)
  • Extract values from the external financial application's database for the requested columns in table ucode1. This table currently contains two rows:
    Code Description
    1000 Dept 1000 - Packaging
    2000 Dept 2000 - Inspection
       
  • Use the mapping information to build an "updatecollection" XML request (see below) to be sent back to SyteLine.
  • Place the XML request in SyteLine's mailbox.

The "UpdateCollection" XML request would be similar to this:

<IDORequest>

 <RequestHeader UserName="ExtFin User" Password=Password_Value PasswordEncrypted="N" Type="UpdateCollection" New="1" SkipTriggers="0">

 <SourceName>EXTFIN</SourceName>

 <TargetName>SyteLineSite</TargetName>

style="clear: none;" />

 <RequestData ObjectType="1">

 <UpdateCollection Name="TABLE!unitcd1">

  <Items>

   <Item ItemNo="0" Action="Insert">

style="clear: none;" />

    <Property Name="unit1" Modified="Y" xml:space="preserve">1000</Property>

    <Property Name="description" Modified="Y" xml:space="preserve">Dept 1000 - Packaging</Property>

style="clear: none;" />

    <Property Name="CreatedBy" Modified="Y" xml:space="preserve">ExtFin User</Property>

    <Property Name="UpdatedBy" Modified="Y" xml:space="preserve">ExtFin User</Property>

   </Item>

   <Item ItemNo="1" Action="Insert">

style="clear: none;" />

    <Property Name="unit1" Modified="Y" xml:space="preserve">2000</Property>

    <Property Name="description" Modified="Y" xml:space="preserve">Dept 2000 - Inspection</Property>

style="clear: none;" />

    <Property Name="CreatedBy" Modified="Y" xml:space="preserve">ExtFin User</Property>

    <Property Name="UpdatedBy" Modified="Y" xml:space="preserve">ExtFin User</Property>

   </Item>

  </Items>

 </UpdateCollection>

 </RequestData>

 </RequestHeader>

</IDORequest>

Note:  The values for the properties CreatedBy and UpdatedBy should be set to the value of RequestHeader UserName. In the example above, the value is ExtFin User.