After the import has been run, use the logImportReport
method to view details about failed and successful rows. The report shows six types of errors
ErrorType | Description | |
---|---|---|
N | Not in Mapping. a mandatory field in the destination type is not mentioned in the input function. | |
M | Missing. the input CSV line did not have a value for this field | |
I1 | Invalid. the input CSV value was invalid. Usually means a type conversion error. For example for a field wid int , a value “abc” would produce this error. | |
I2 | Invalid. Validation rule for this field failed. For example, a validation rule taxCode.maxlen(3) would produce this error for an input value of “ARST”. | |
D | Duplicate error. The field is unique and the input value already exists in another row. | |
R | Relation error. The field is a relation and the input value is not a valid foreign key value. |
Use this function:
DataImportService importSvc = delia.createImportService();
//...
importSvc.logImportReport();
It will write the following to the log:
IMPORT 192 rows. 180 successful, 12 failed
Customer N M I1 I2 D R
id [ 0]: 0, 0, 0, 0, 0, 0
wid [ 1]: 0, 8, 8, 0, 0, 0
name [ 2]: 0, 0, 0, 4, 0, 0
TOTALS : 0, 8, 8, 4, 0, 0