DataImporter - Import Lease Contracts

SHOW ALL CONTENT

Table of contents

Overview

This article explains how to import lease contracts.

References

 

What you need to know:

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

Required Fields

  • Number - Text (50)
    • Represents the lease contract number
    • Can contain letters or numbers
    • The number does not need to be unique
  • Supplier - Text (500)
    • Name of the lease contract supplier
    • The system will create the supplier during import if it does not already exis
    • Related to the supplier module. For more information, refer to Import suppliers
  • StartDate - Date and Time
    • Represents the lease contract start date and must be less then the end date
    • The date format must be compatible with the server settings (YYYY-MM-DD)
  • EndDate - Date and Time
    • Represents the lease contract end date and must be greater then the start date
    • The date format must be compatible with the server settings (YYYY-MM-DD).

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)
    • Represents the purchase order number for the lease contract
  • CostCenter – Text (50)
    • The cost center who will be charged for the lease contract
  • Cost – Decimal
    • Total cost of the lease contract
    • The value must be between 0 and 9 999 999.99
    • Example: 1234567,89
  • Description - Text (5000)
    • Lease contract description
  • Note - Text (5000)

Configuration File (XML)

The declaration of the source is done by indicating the LeaseContract 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" ?> 
<Sources>
   <Source Name="ImportLeaseContracts">
      <ConnectionString>Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Import\LeaseContracts.xlsx;Extended Properties="Excel 12.0 Xml;HDR=Yes";</ConnectionString>
      <ViewName>[Import LeaseContract$]</ViewName>
      <Content>LeaseContract</Content>
   </Source>
</Sources>

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 lease 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 exept:

  • 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 
 

<EmptyValueHandling>VALUE</EmptyValueHandling>
X
Help us improve our articles








Help us improve our articles