Log Message: |
Improved: Import file with data-file, add start-line to escape the header column line (OFBIZ-10108)
When you load a CSV file some time with a data-file definition, if it contains some header column you can use the format attribute of you column.
Example:
ref;date
100;2017-10-10
200;2017-12-11
This definition failed :
<data-file name="MyCsvTest" separator-style="delimited" type-code="text" delimiter=";">
<record name="Test">
<field name="ref" type="String" position="1"/>
<field name="date" type="CustomTimestamp" format="yyyyy-MM-dd" position="2"/>
</record>
</data-file>
You need to read the date as string and after convert it on your code to escape the first line.
To solve it I added a new attribute start-line on data-file element :
<data-file name="MyCsvTest" separator-style="delimited" type-code="text" *start-line="1"* delimiter=";">
<record name="Test">
<field name="ref" type="String" position="1"/>
<field name="date" type="CustomTimestamp" format="yyyyy-MM-dd" position="2"/>
</record>
</data-file>
|