An error occured - 7b81696d-9da9-45e7-a193-beafd021787d itgensgr140: A duplicate of a previous row was found as row #12 on VismaNet.JournalTransactionV2.JournalTransactionsByPeriodOrDateV2. (820248550)

On the following SQL on Visma.net and SQL Server I get:

An error occured - 7b81696d-9da9-45e7-a193-beafd021787d
itgensgr140:
A duplicate of a previous row was found as row #12 on VismaNet.JournalTransactionV2.JournalTransactionsByPeriodOrDateV2.
(820248550).

SQL:

select *
from   JournalTransactions@vnt

The following query of the view JournalTransactions also returns an error:

select fpd.period financialPeriod
,      fpd.year financialYear
,      jtn.* except financialPeriod
from   VismaNet.FinancialPeriod.FinancialPeriods@vnt fpd
join   VismaNet.JournalTransactionV2.JournalTransactionsByPeriodOrDateV2@vnt
       ( company_code => fpd.company_code
       , periodId => fpd.period
       ) jtn

As does:

select jtn.*
from   VismaNet.JournalTransactionV2.JournalTransactionsByPeriodOrDateV2@vnt
       ( company_code => 719400
       , periodId => 201801
       ) jtn

Anyone else experiencing the same? Is there something wrong with the function?

An analysis was made of the raw API-data received (as described in Collect Native Platform Call Data).

The third query receives data spread as answer of a few API-calls. Each answer has a specific number of rows, as indicated by the Visma.net specifications.

The error occurs since for the batch 1100012 since that batch occurs in two answers:

select *
from   jsontable
       ( '[*]'
         passing file 'apidata.json'
         columns batchNumber              varchar2  path 'batchNumber'
         ,       ledger                   varchar2  path 'ledger'
         ,       postPeriod               varchar2  path 'postPeriod'
       ) j

as shown in this picture:

image

There are 10 transaction lines for batch 1100012, but the first three lines are returned in the first answer, and the other seven lines in the next answer.

select *
from   jsontable
       ( '[*].journalTransactionLines[*]'
         passing file 'c:\temp\formatted.json'
         columns lineNumber               varchar2  path 'lineNumber'
         ,       accountNumber            varchar2  path 'accountNumber'
         --
         ,       batchNumber              varchar2  path '::ancestor.batchNumber'
         ,       ledger                   varchar2  path '::ancestor.ledger'
         ,       postPeriod               varchar2  path '::ancestor.postPeriod'
       ) j
where  batchNumber = 1100012

as shown in this picture:

image

The strange thing is that this problem is not occurring for any other user of the Visma.net-connector in the last six months.

The Invantive-code logic expects when specifying a number of rows to be retrieved on an API-call, that the number of rows is the number of rows on the top-level (so batches here). It is known that the Visma.net-API has had several issues with row counts over the last 4 years when paging was added.

When looking at the documentation for this table:

there is a text included from the OpenAPI-specification by Visma which signals this problem for specifically this table:

Get a range of Journal Transactions - ScreenId=GL301000. On this particular endpoint, pagesize and totalcount denotes number of journaltransaction lines. When using pagination, the transactions for one specific batch can be split into several responses. Please use a page size lower or equal to the allowed max page size which is returned under metadata. If pagesize is greater than the max page size, it will be limited to max page size.

This text is automatically included by Invantive SQL into the documentation from Visma’s documentation and the API works as documented by Visma. It is not really practical for retrieving transactions, but that is something Invantive SQL must handle.

For the moment, please try to resolve the problem by switching to the transaction lines table:

As a structural solution, we will change the logic specifically for this table. There was already deviating logic for JournalTransactionLinesByPeriodOrDateV2 and JournalTransactionsByPeriodOrDateV2 in terms of determination whether all API-answers had been fetched. This will now be extended as follows:

  • eat duplicate rows as well as possible for JournalTransactionsByPeriodOrDateV2 instead of raising an error for tables which are documented to return duplicate rows.
  • for all other tables, raise an error when two duplicate rows are detected (original behaivour)

Please note that this problem as far as known only involves the two tables listed and is a (documented) peculiarity of the Visma.net APIs which we did not oversee the possible ramifications which caused specifically for your environment this error.

A new release has been taken into production that should resolve this issue.

Can you please try again?

In case the issue has been solved: check the solution checkbox. In case not, please add a reply with the error code and message, and time of occurrence.

A further fine-tuned release has been taken into production that should resolve and avoid this issue.

Can you please try again?

In case the issue has been solved: check the solution checkbox. In case not, please add a reply with the error code and message, and time of occurrence.

This question was automatically closed after at least 2 weeks of inactivity after a possible solution was provided. The last answer given has been marked as a solution.

Please ask a new question via a separate topic if the problem occurs again. Please include a link to this topic in the new question by pasting its URL into the text.