My Products
Help
gerrit_deglee
CONTRIBUTOR **

Incorrect metadata totalcount in JournalTransactionV2 since this morning

by gerrit_deglee

Hi, we use the following request to verify we have all expected records in our DWH. Since this morning the JournalTransactionV2 endpoint returns metadata.totalcount of 1 instead of the expected number, causing our validation to fail.

https://integration.visma.net/API/controller/api/v2/journaltransaction?pageNumber=1&pageSize=1&perio...

 

If I change the pagesize to 2, I get a totalcount of 2. If I change it to 3, I get two records, one with a totalcount of 113230, the other with totalcount of 1. One query should return the same totalcount in all cases I assume. The 113230 is the number I would expect.

 

Thanks

7 REPLIES 7

by Magnus Johnsen (Updated ‎10-11-2020 12:51 by Magnus Johnsen VISMA )

Hi,

 

We can confirm there is an issue and are currently looking in to it.

 

What we have found so far:

 

v2/journalTransaction?periodId=202002

  • Batches= 6
  • Lines = 20
  • Metadata on each batch, all except last shows metaData count = 20
  • Last shows metaData = 3

v2/journalTransaction?periodId=202002&pageSize=1&pageNumber=1

  • Batches=1
  • Lines=1
  • Metadata count = 1
  • Returns correct amount of pages, but impossible to tell by metaDataCount.


v2/journalTransaction?periodId=202002&pageSize=2&pageNumber=1

  • Batches=1
  • Lines=2
  • Metadata count = 2

 

v2/journalTransaction?periodId=202002&pageSize=2&pageNumber=3

  • Batches = 2
  • Lines = 2
  • Metadata Count = 20 on first batch
  • Metadata = 1 on last batch

Conclusion:

MetaData Count should only be included once in the response and should reflect total amount of lines in dataset.
It seems like the last returned batch gets a metaData count that is the amount of lines in that batch, so if 1 batch is included in the response, the metaData shows how many lines that batch includes in the result.
If there are several batches, the first batches all return the correct metaData count, but the last batch contains a metaData count that reflects the remaining lines.

 

We are reporting this to the development team and will get back to you when we have more information. 

Hi,

Right now the workaround right now would be to get the next page until the result is an empty array.

The development team is currently working on solving the issue. 

Accepted solution
Magnus Johnsen
VISMA

Hi,

This issue was resolved in the patch deployed this night.

You can see the patch notes here: Scheduled minor maintenance for Visma.net ERP / API (Nov 12, 22:30 CET - Nov 13, 00:30 CET)

 

Please let us know if you are still having issues.

 

Thank you. 

Anonymous
Not applicable

by Anonymous

I might have another issue here:

 

I'm calling this url: https://integration.visma.net/API/controller/api/v2/journaltransaction?periodId=202012&pageNumber=1&...

 

I'd expect the result to return 1000 journalTransactions but I only get 482. Where the metadata totalCount is 62168

 

When paging threw the Items getting to page 64, I'm not getting anymore results but I only recieved around 11.000 items. (none of the pages gives me 1000 items)

 

 

 

I'm aware that the pageSize is limited to 1000, I'd like to make sure I get as many as possible and not worry about the pageSize being upped later on.

by Magnus Johnsen

What are you counting?

The endpoint is returning lines and not whole batches.

2021-01-15 09_54_39-Window.png

Anonymous
Not applicable

by Anonymous

😞 Read.... read.... read.... I Was calculating the JournalTransactions not the lines... that makes sense!

by Magnus Johnsen

No worries, it is a lot to read at first. 🙂