My Products
Help
ErikW
PARTNER

Error when trying to retrieve customerCreditNotes

by ErikW

Hi encounter a strange error when trying to retrieve customer credit notes using the following url: https://integration.visma.net/API/controller/api/v1/customerCreditNote?pagenumber=1&pagesize=1000&pe...

Posting the full error message/stacktrace that is returned from the Visma.Net api below. This has worked previously.

{
    "message""An error has occurred.",
    "exceptionMessage""The 'CompressedContent' type failed to serialize the response body for content type 'application/json; charset=utf-8'.",
    "exceptionType""System.InvalidOperationException",
    "stackTrace"null,
    "innerException": {
        "message""An error has occurred.",
        "exceptionMessage""Incorrect syntax near '0200009565'.\r\nUnclosed quotation mark after the character string ') AND [ARInvoice_ARInvoice].CompanyID = @CompanyIdBql AND [ARInvoice_ARInvoice].[DocType] = [ARInvoice_ARRegister].[DocType] AND [ARInvoice_ARInvoice].[RefNbr] = [ARInvoice_ARRegister].[RefNbr] OPTION(OPTIMIZE FOR UNKNOWN) /*  */'.",
        "exceptionType""System.Data.SqlClient.SqlException",
        "stackTrace""   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)\r\n   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)\r\n   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)\r\n   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()\r\n   at System.Data.SqlClient.SqlDataReader.get_MetaData()\r\n   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)\r\n   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)\r\n   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)\r\n   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)\r\n   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)\r\n   at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)\r\n   at Visma.net.ERP.BqlExtension.CustomBqlCommand.<ExecuteCommandInner>d__22.MoveNext() in D:\\Data\\BuildAgent\\work\\11023e52ea15d342\\Web\\Lib\\Visma.net.ERP.BqlExtension\\Visma.net.ERP.BqlExtension\\CustomBqlCommand.cs:line 217\r\n   at Visma.net.ERP.BqlExtension.CustomBqlCommand.<Execute>d__26.MoveNext() in D:\\Data\\BuildAgent\\work\\11023e52ea15d342\\Web\\Lib\\Visma.net.ERP.BqlExtension\\Visma.net.ERP.BqlExtension\\CustomBqlCommand.cs:line 326\r\n   at Visma.net.ERP.Api.AR.Repository.InvoiceRepository.<old_GetArDocumentsPaginationUpFront>d__25.MoveNext() in D:\\Data\\BuildAgent\\work\\11023e52ea15d342\\Web\\Lib\\Visma.net.ERP.Api\\AR\\Repository\\InvoiceRepository.cs:line 802\r\n   at Visma.net.ERP.Web.Api.Repositories.CustomerInvoiceWebRepository.<GetAllCustomerDocuments>d__28`1.MoveNext() in D:\\Data\\BuildAgent\\work\\11023e52ea15d342\\Web\\Lib\\Visma.net.ERP.Web.Api\\Repositories\\InvoiceWebRepository.cs:line 465\r\n   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()\r\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList(JsonWriter writer, IEnumerable values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\r\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)\r\n   at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)\r\n   at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, Encoding effectiveEncoding)\r\n   at System.Net.Http.Formatting.JsonMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, Encoding effectiveEncoding)\r\n   at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.WriteToStreamAsync(Type type, Object value, Stream writeStream, HttpContent content, TransportContext transportContext, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)\r\n   at PX.Api.Compression.BaseCompressor.<Compress>d__4.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)\r\n   at PX.Api.Compression.CompressedContent.<SerializeToStreamAsync>d__4.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)\r\n   at System.Web.Http.WebHost.HttpControllerHandler.<WriteBufferedResponseContentAsync>d__22.MoveNext()"
    }
}

 

4 REPLIES 4

by Magnus Johnsen

Hi,

We'll look into it and forward this to the development team.

Does it only happen on the customerCredit endpoint?

Does it happen for all calls on customerCredit?

ErikW
PARTNER

by ErikW

Great, thanks! Do you require a company id? It seems to only occur on this endpoint and for all get requests as far as I can tell.

by Magnus Johnsen

That would help, please send it to DeveloperSupport@visma.com.

Thank you. 

ErikW
PARTNER

by ErikW (Updated ‎12-09-2023 13:31 by ErikW PARTNER )

It is quite critical that this is resolved. We are in the process of selling a company and need to extract all pertinent financial data, including attachments, in order to hand this over to the buyer.