API Forum

This forum is in read-only mode.
Please refer to our API support in case you have any questions.
We can be reached at api@e-conomic.com
e-conomic API developer forum

rollback on error, cant delete invoices

0
i need to be able to do a rollback when creating multiple invoices if any error happens.

the way i do that now is a save an array with the handles of the invoices i create and if i get an error i then try to delete all the invoices previosly created, but i cant delete the invoices after an error occurs.

if i manually delete the invoices in a session they gets deleted without any problems.
created Nov 21, 2014 by consendo
0% Accept Rate
Q 2 A 0 C 0

1 Answer

0

Hi,

This is indeed possible, but only for CurrentInvoices. Once invoices are booked they cannot be deleted, so create all invoices before booking them.

Keep track of the CurrentInvoice handle (which you already have) and use the CurrentInvoice_Delete method to delete the current invoice(s).

Cheers,

Bo

answered Dec 8, 2014 by bro_delacourfs
Visma e-conomic A/S
...