Skip to main content

Data Validation

Validating Data When Saving

Written by Lenka Haringerová

Data validation is performed when saving records. Errors can be of three types:

  • error: the record cannot be saved due to this error and the operation has been cancelled

  • warning: a problem occurred during saving, but the record was saved.

  • information: additional information for the user. The record was saved.

Example of an error when saving:

<?xml version="1.0"?><winstrom version="1.0">  <success>true</success>  <result>    <id>105</id>    <warnings>      <warning for="radekDph">Z&#xE1;znam nem&#xE1; vypln&#x11B;n &#x159;&#xE1;dek DPH a proto nebude doklad za&#xFA;&#x10D;tov&#xE1;n.</warning>    </warnings>    <infos>      <info> Do&#x161;lo k automatick&#xE9;mu v&#xFD;b&#x11B;ru v&#xFD;robn&#xED;ho &#x10D;&#xED;sla.</info>    </infos>  </result>  <result>    <id>103</id>  </result></winstrom>

If the application encounters an error, processing is immediately terminated. For warnings and informational messages, the complete import is performed and all error states are then returned. If you want to prevent data from being saved even in the case of a warning, add the following URL parameter: "?fail-on-warning=true".

If you want to validate a record without saving it (a so-called dry-run), add the URL parameter "?dry-run=true".

Did this answer your question?