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

SetProduct Exception


When I try to set product to Invoice line I got exception:

Type : Economic.Api.Exceptions.IntegrityException, Economic.Api, Version=, Culture=neutral, PublicKeyToken=0b95ee7ebdda7bdd


Message : (My product name) is barred. 
TargetSite : Void CurrentInvoiceLine_SetProduct(Economic.Api.Client.WebService.CurrentInvoiceLineHandle, Economic.Api.IProduct)
HResult : -2146233088
Stack Trace :    в Economic.Api.EconomicSession.CurrentInvoiceLine_SetProduct(CurrentInvoiceLineHandle handle, IProduct value)
Yesterday it is worked, but today not
created Apr 16, 2013 by isk
100% Accept Rate
Q 1 A 0 C 0

1 Answer

Best answer
Hi isk,


This is the result of a bug fix preventing the creation of e.g. CurrentInvoiceLine's with barred products.

For a product to be set on a CurrentInvoiceLine, it must be non-barred, i.e. accessible. This is determined by the product's IsAccessible property.


Best regards,
answered Apr 24, 2013 by Christian Estrup
selected Apr 24, 2013 by Jostein
Visma e-conomic A/S