Missing transactions in new Visma.net view for JournalTransactions

In the new view JournalTransactions on Visma.net I am missing a number of transactions.

For example, the following transaction 000090 exists:

select company_code
,      batchnumber
,      financialPeriod
from  JournalTransactionsByNumberV2 (COMPANY_CODE=>..., journalTransactionNumber => '000090')@vnt

The journal transaction also has three lines:

select company_code
,      batchnumber
,      lineNumber
,      financialPeriod
from  JournalTransactionLinesByNumberV2 (COMPANY_CODE=>..., journalTransactionNumber => '000090')@vnt

The lines of this transaction are available through JournalTransactionLines:

select *
from   JournalTransactionLines@mss
where  company_code = ...
and    batchnumber = '000090'

but not in the view:

select *
from   JournalTransactions@mss
where  company_code = ...
and    batchnumber = '000090'

The problem has been reproduced.

The first query retrieves transactions on 201811 from which there are 29 reported, but no batch number 000090.

select sum
       ( case
         when batchnumber = '000090'
         then 1
         else 0
         end
       ) cnt_match -- 0
,      count(*) cnt_total -- 29
from   VismaNet.JournalTransactionV2.JournalTransactionsByPeriodOrDateV2@vnt  
       ( company_code => ...
       , periodId     => '201811'
       ) jtn

The second one retrieves the batch number 000090, which then exists:

select count(*) cnt -- 1
from   JournalTransactionsByNumberV2
       ( COMPANY_CODE => ...
       , journalTransactionNumber => '000090'
       )@vnt
where  batchnumber     = '000090'
and    financialPeriod = '201811'
and    company_code    = ...

It is unclear yet why the retrieval does not find the transaction, but does find transaction lines. A developer will look into this.

Request retrieving 000090

JSON
{
  "Url":"https://integration.visma.net/API/controller/api/v2/journaltransaction/000090",
  "Success":true,
  "CallDirection":0,
  "Id":2,
  "DateRegisteredUtc":"2022-06-02T09:19:07.5868838Z",
  "RequestBodyAsString":"",
  "ResponseBodyAsString":"{\"module\":\"ModuleAP\",\"batchNumber\":\"000090\",\"status\":\"Posted\",...}]}",
  "StartUtc":"2022-06-02T09:19:07.5861362Z",
  "TableFullQualifiedName":"VismaNet.JournalTransactionV2.JournalTransactionsByNumberV2",
  "ManagedThreadId":104,
  "ProcessId":133237,
  "Uid":"deee3986-216c-4e71-bd5e-fe7d21db8c75",
  "GuiAction":"ResultJson",
  "GuiLanguage":"en",
  "GuiModuleName":"Invantive Cloud",
  "GuiModuleVersion":"22.0.212-PROD+3419",
  "MessageText":"GET",
  "MessageCode":"itgenoda435",
  "CallUid":"d1fc5826-a816-4191-8e8c-d2cc8a554c02",
  "ResponseStatus":"OK",
  "PartitionCode":"...",
  "Parameters":[
    {
      "Name":"COMPANY_CODE",
      "DotnetDataType":"string",
      "Value":"...",
      "IsDefaultValue":false
    },
    {
      "Name":"journalTransactionNumber",
      "DotnetDataType":"string",
      "Value":"000090",
      "IsDefaultValue":false
    }
  ],
  
  "RequestContents":"Automatic decompression: None
Maximum automatic redirections: 50
Maximum response headers length: 64
Protocol version: 1.1
Timeout: 100.000 ms
Continue Timeout: 350 ms
Read/write Timeout: 300.000 ms
Send chunked: False
Request header Accept: application/json
Request header Authorization: Bearer ...
Request header ipp-application-type: Visma.net Financials
Request header ipp-company-id: ...
",

  "ResponseContents":"Content length: -1
Is from cache: False
Protocol version: 1.1
Response URI: https://integration.visma.net/API/controller/api/v2/journaltransaction/000090
Header Cache-Control: no-cache
Header Connection: Keep-Alive
Header Content-Type: application/json; charset=utf-8
Header Date: Thu, 02 Jun 2022 09:19:07 GMT
Header Expires: -1
Header Feature-Policy: geolocation 'none'; vr 'none'; payment 'none'; midi 'none'; microphone 'none'; fullscreen 'none'; encrypted-media 'none'; camera 'none'; autoplay 'none';
Header ipp-request-id: 7df24505-319b-4327-8ccd-2c87267bdac2
Header Keep-Alive: timeout=15, max=100
Header Pragma: no-cache
Header Referrer-Policy: origin-when-cross-origin
Header Server: Apache/2.4.25, (Debian)
Header Set-Cookie: LegacyUI=0; path=/; secure; HttpOnly,UserBranch=13; path=/; secure; HttpOnly,Locale=TimeZone=GMTE0000U&Culture=en-GB; path=/; secure; HttpOnly,UserDisplayName=; expires=Wed, 01-Jun-2022 09:19:07 GMT; path=/; secure; HttpOnly
Header Strict-Transport-Security: max-age=31536000; includeSubDomains, max-age=31536000; includeSubDomains
Header Transfer-Encoding: chunked
Header VnfInstanceId: ERP_NO_REAL_0013
Header X-Content-Type-Options: application/json
Header X-Handled-By: Acumatica-PX.Export/AuthenticationManagerModule
Header X-XSS-Protection: 1;mode=block
Cookie LegacyUI - : 0 on integration.visma.net// (secure True)
Cookie UserBranch - : 13 on integration.visma.net// (secure True)
Cookie Locale - : TimeZone=GMTE0000U&Culture=en-GB on integration.visma.net// (secure True)
",
}

Request retrieving no 000090

JSON
{
  "Url":"https://integration.visma.net/API/controller/api/v2/journaltransaction?pageNumber=1&pageSize=100&periodId=201811",
  "Success":true,
  "CallDirection":0,
  "Id":1,
  "DateRegisteredUtc":"2022-06-02T09:19:05.144983Z",
  "RequestBodyAsString":"",
  "ResponseBodyAsString":"[{\"module\":\"ModuleCA\",\"batchNumber\":\"000001\",\"status\":\"Posted\",...}],\"metadata\":{\"totalCount\":691,\"maxPageSize\":1000}}
  ,{\"module\":\"ModuleAP\",\"batchNumber\":\"000002\",\"status\":\"Posted\",...,\"journalTransactionLines\":...,\"metadata\":{\"totalCount\":691,\"maxPageSize\":1000}}
   ,{\"module\":\"ModuleAP\",\"batchNumber\":\"000029\",\"status\":\"Posted\",...,\"journalTransactionLines\":[...],\"metadata\":{\"totalCount\":691,\"maxPageSize\":1000}}]",
  "StartUtc":"2022-06-02T09:19:05.0264143Z",
  "TableFullQualifiedName":"VismaNet.JournalTransactionV2.JournalTransactionsByPeriodOrDateV2",
  "ManagedThreadId":49,
  "ProcessId":133237,
  "Uid":"6360aaf2-a46a-4fef-9256-95dd977c6662",
  "GuiAction":"ResultJson",
  "GuiLanguage":"en",
  "GuiModuleName":"Invantive Cloud",
  "GuiModuleVersion":"22.0.212-PROD+3419",
  "GuiOsUser":"cognito 19ec0ff7-2053-4ef3-9554-005f5c2fbb9d",
  "GuiUser":"19ec0ff7-2053-4ef3-9554-005f5c2fbb9d",
  "MessageText":"GET",
  "MessageCode":"itgenoda435",
  "CallUid":"4d2fe66b-ca1f-4ce1-9c4b-810721566d02",
  "ResponseStatus":"OK",
  "PartitionCode":"...",
  "Parameters":[
    {
      "Name":"COMPANY_CODE",
      "DotnetDataType":"string",
      "Value":"...",
      "IsDefaultValue":false
    },
    {
      "Name":"periodId",
      "DotnetDataType":"string",
      "Value":"201811",
      "IsDefaultValue":false
    }
  ],
  "RequestContents":"Automatic decompression: None
Maximum automatic redirections: 50
Maximum response headers length: 64
Protocol version: 1.1
Timeout: 100.000 ms
Continue Timeout: 350 ms
Read/write Timeout: 300.000 ms
Send chunked: False
Request header Accept: application/json
Request header Authorization: Bearer ...
Request header ipp-application-type: Visma.net Financials
Request header ipp-company-id: ...
",
  "ResponseContents":"Content length: -1
Is from cache: False
Protocol version: 1.1
Response URI: https://integration.visma.net/API/controller/api/v2/journaltransaction?pageNumber=1&pageSize=100&periodId=201811
Header Cache-Control: no-cache
Header Connection: Keep-Alive
Header Content-Security-Policy: frame-ancestors *.visma.net ec2amaz-h54j35f localhost
Header Content-Type: application/json; charset=utf-8
Header Date: Thu, 02 Jun 2022 09:19:04 GMT
Header Expires: -1
Header Feature-Policy: geolocation 'none'; vr 'none'; payment 'none'; midi 'none'; microphone 'none'; fullscreen 'none'; encrypted-media 'none'; camera 'none'; autoplay 'none';
Header ipp-request-id: 6aae350c-6856-46af-86d9-9edec1dea81a
Header Keep-Alive: timeout=15, max=100
Header Pragma: no-cache
Header Referrer-Policy: origin-when-cross-origin
Header Server: Apache/2.4.25, (Debian)
Header Set-Cookie: LegacyUI=0; path=/; secure; HttpOnly,UserBranch=13; path=/; secure; HttpOnly,Locale=TimeZone=GMTE0000U&Culture=en-GB; path=/; secure; HttpOnly,UserDisplayName=; expires=Wed, 01-Jun-2022 09:19:04 GMT; path=/; secure; HttpOnly
Header Strict-Transport-Security: max-age=31536000; includeSubDomains, max-age=31536000; includeSubDomains
Header Transfer-Encoding: chunked
Header VnfInstanceId: ERP_NO_REAL_0013
Header X-Content-Type-Options: application/json
Header X-Handled-By: Acumatica-PX.Export/AuthenticationManagerModule
Header X-XSS-Protection: 1;mode=block
Cookie LegacyUI - : 0 on integration.visma.net// (expires 01-01-0001 00:00:00, secure True)
Cookie UserBranch - : 13 on integration.visma.net// (expires 01-01-0001 00:00:00, secure True)
Cookie Locale - : TimeZone=GMTE0000U&Culture=en-GB on integration.visma.net// (expires 01-01-0001 00:00:00, secure True)
",
}

A bug has been fixed in release 22.0.218, which has already been deployed to Invantive Cloud production.

The Visma.net API has a different logic for calculating the number of rows retrieved for a limited number of tables. By accident, the table function VismaNet.JournalTransactionV2.JournalTransactionsByPeriodOrDateV2 was excluded as a special case.

A cross check was made to ensure that both journal transactions and journal transaction lines have the same number of distinct batch numbers:

select count(distinct batchnumber)
from   VismaNet.FinancialPeriod.FinancialPeriods@vnt fpd
join   VismaNet.JournalTransactionV2.JournalTransactionsByPeriodOrDateV2@vnt
       ( company_code => fpd.company_code
       , periodId => fpd.period
       ) jtn
where fpd.period = '201811'
and fpd.company_code=...

and

select count(distinct batchnumber)
from   VismaNet.FinancialPeriod.FinancialPeriods@vnt fpd
join   VismaNet.JournalTransactionV2.JournalTransactionLinesByPeriodOrDateV2@vnt
       ( company_code => fpd.company_code
       , periodId => fpd.period
       ) jle
where fpd.period = '201811'
and fpd.company_code=...

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.