DataImporter - Import Service Contracts - Internal Mode


Table of contents


This article explains how to import service contracts to be used in an internal mode - the default in Octopus.

If you are using Octopus in an external support mode, refer to the Import Service Contracts - External Mode article.



What you need to know:

The reference template files (.xlsx et .xml) to prepare imports are included in the file.

Required Fields

  • Number - Text (50)
    • Represents the contract number
    • Can contain letters or numbers
    • The number does not need to be unique
  • Type - Text (100)
    • Service contract type (Parts and Labour, Maintenance, Extended Warranty, etc.)
    • If the type does not already exist, it will be created during import
    • The service contract type can be configured from the Tools > Reference Data Management > General > Service contract types menu
  • StartDate - Date and Time
    • Represents the contract start date
    • The date format must be compatible with the server settings; YYYY-MM-DD
  • EndDate - Date and Time
    • Represents the contract end date and must be greater then the start date
    • The date format must be compatible with the server settings; YYYY-MM-DD
  • Supplier - Text (500)
    • Represents the name of the contract supplier
    • To import suppliers, refer to the Import suppliers article

Optional Fields

  •  IsRenewed – Boolean
    • Indicates that a contract has been renewed.
    • Accepted values are: 1 or 0, True or False, Yes or No.
    • By default, if this field is not filled, it will not be activated during creation and will stay as is during update.
  • PurchaseOrderNumber - Text (50)
    • The purchase order number for the contract
  • CostCenter - Text (50)
    • Represents the cost center
  • Cost – Decimal
    • The value must be between 0 and 9 999 999.99
    • Example: 1234567.89
  • Description - Text (5000)
    • Description of the service contract
    • Part of this description will appear in the CI file
  • Note - Text (5000)
    • Service contract note tab
    • This field replaces the existing data at each import. The program does not add the information, but replaces it

Configuration File (XML)

The declaration of the source is done by indicating the ServiceContract value in the <Content> tag. 

NOTE: The XML file used as this example is for an import done from Excel 2007 or 2010. 

<?xml version="1.0" encoding="utf-8" ?> 
   <Source Name="Import Internal Service Contract">
      <ConnectionString>Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\import\ServiceContract.xlsx;Extended Properties="Excel 12.0 xml;HDR=Yes;";</ConnectionString>
      <ViewName>[Import InternalContract$]</ViewName>

To explain the tags used in all types and to find out more about the types of files, please refer to the XML Configuration File article.

Information on Additional Tags

To import service contracts, the XML file can contain 1 additional tag. This tag is not mandatory and if it's not specified, the default value will be used. 

Management of Empty Fields

DataImporter can help clean the data contained in Octopus when empty fields are encountered. If this tag is not present, the NoChange default value will be used. 

If you want to use this tag as part of an import, it is important that your data source only contain columns to act on. DataImporter will systematically try to clean all these columns. You can clean all fields except:

  • Required fields
  • Fields that have been configured as mandatory in the Octopus database
  • Fields that accept only specific values, for example boolean type fields (yes/no)

Permitted values for the EmptyValueHandling tag

  • Clear: The existing value in Octopus will be cleared and the field will be empty
  • NoChange (Default Value): Fields that are empty in the data source being imported will be ignored and the existing value in Octopus will be kept

To use this tag, add the following line to the XML file 

Help us improve our articles

Help us improve our articles