Skip to main content

Data Validation

Validating Data When Saving It

Written by Lenka Haringerová

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

  • error: the record cannot be saved due to this error and the operation was canceled

  • warning: an issue occurred while saving, but the record was saved.

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


Example of an error during 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 stopped immediately. For warnings and information, the entire import is completed and all error states are then returned. If you want data not to be saved even in the case of a warning, add the parameter: “?fail-on-warning=true” to the URL.

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

Did this answer your question?