When importing a record, you can specify behavior depending on whether the record already exists. This lets you ensure that a related record is only imported if it doesn't already exist. If it already exists, the user may have already modified it, so we won't import it again and overwrite the values.
The mode can be specified separately for each record and also for each operation (create/update):
<winstrom version="1.0">
<faktura-vydana update="ignore">
<id>123</id>
...
</faktura-vydana>
</winstrom>
Modes for creating and updating
Operation | Mode | Description |
Create |
| If the record does not exist, ignore the request to create it. |
| If the record does not exist, fail. | |
| If the record does not exist, create it normally. Default value. | |
Update |
| If the record already exists, ignore the request to update it. |
| If the record already exists, fail. | |
| If the record already exists, update it normally. Default value. |
ℹ️ How to recognize modes in the response: with ignore, the server responds 200, but returns no <id> — the record was skipped. With fail, it responds 400 with message code importXmlCreateNeniPovolen, resp. importXmlUpdateNeniPovolen.
Behavior for an unresolved relation
A similar mechanism to the one used for skipping rows can also be used for relations:
<winstrom version="1.0">
<faktura-vydana>
<firma if-not-found="null">code:FIRMA</firma>
...
</faktura-vydana>
</winstrom>
In this case, if a company with the code FIRMA is not found, the relation will instead be set to null (i.e., empty).
Value | Description |
| If the record does not exist, do not set the relation. |
| If the record referenced by the code does not currently exist but existed in the past, the relation is made to the most recent no-longer-valid record. The date used is the document date, event date, etc. This is useful, for example, when importing historical documents linked to account numbers that are no longer valid. |
| If the record referenced by the code does not exist, it is created automatically. For code-list type records, the code / name properties are filled in based on the reference value (e.g., |
⚠️ Without the if-not-found attribute, a reference to a non-existent record will result in the error 400. So if you're importing data from a foreign system where relations may not be complete, include this attribute — otherwise the entire import will fail.
