to get a personalized navigation.
to get a personalized navigation.
Hello
We are developing an incoming invoice integration between our system and NXT.
Our current flow for validating voucher errors is something like this:
1. Create batch and vouchers using batch_create and voucher_create
2. Store the batch and voucher number in our database
3. Update batch using batch_processings -> updateBatch to finalize it
4. Delete the batch if updateBatch failed to enable the user to fix the problems on our end
updateBatch sometimes gives us errors, such as a voucher missing orgUnit1 or orgUnit2.
However, deleting the batch to start over feels like an unneccesarily complicated and slightly risky solution.
Is it possible to know if it's a valid voucher in step 1, and give the user a chance to fix the problems on our end before ever creating the voucher in NXT?
Or is there another preferred way of handling these validation errors?
Try running the processing validateBatch separately before updateBatch, it will return an array of errors (if any), similar to the message you'll get in the UI if anything mandatory is missing, like cost units on certain accounts etc. Something like this for instance:
What does valid voucher mean here? Can't you use the information in the error to figure out what you need to properly set?
Copyright © 2022 Visma.com. All rights reserved.