My Products
Help
mortenRStrømnes
CONTRIBUTOR **

Do a Query on CompanyInformation_Processings?

by mortenRStrømnes

Hi.

In the table CompanyInformation_Processings.
I need to do a query in order to read the currentSuspensionDate in VB NXT on company level, but as far as I understand from the API docs this is only available as a mutation.
I don't want to change (mutate) the currentSuspensionDate through the API, I just want to read (query) it.

 

Please advice, thanks.

6 REPLIES 6

by Marius Bancila (Updated ‎30-09-2022 16:10 by Marius Bancila VISMA )

The suspension date is stored in the companyMaster table. This is a sort of key-value pair storage. The value of the suspension date is stored with key 12. So you need to do this:

 

 

query ($cid :Int!) {
  useCompany(no: $cid) {
    companyMaster(filter:{primaryKey : {_eq : 12}}) {
      items {
        value      
      }
    }
  }
}

 

 

mortenRStrømnes
CONTRIBUTOR **

Hi Marius and thanks for quickly replying.

I tried to run the query you sent but got no item values in the response body.

 

current suspension date in UI is 30.09.2022:

mortenRStrmnes_0-1664782894770.png

 

 

Response body and vbnxt-trace-id below:

 

{
"data": {
"useCompany": {
"companyMaster": {
"items": null
}
}
},
"extensions": {
"vbnxt-trace-id": "0000000000000000f3d361a8eda8072b"
}
}

 

What response body do you get using the same example?

I was told the following by my colleagues: if the suspension date has not been set, it is empty. When moving the suspension date, the last day in the previous month is suggested.

 

This means you don't have a suspension date set in your system. But when you're trying to actually set it to, the system suggests by default the last day of the previous month.

 

I hope this answers your question.

mortenRStrømnes
CONTRIBUTOR **

Hi Marius.

Yeah, I agree with you that VB chooses the last day in the previous month, if you don't set a specific date.

But the thing is that I have a specific date already set in the currentSuspensionDate.

But I'm not able to get this date from the API. But it is in the UI.

by Marius Bancila

There is no such table as CompanyInformation_Processings. There is a table called CompanyInformation. Depending on the operation you want to do, there are various fields that are available.

 

For queries:

- companyInformation

- companyInformation_aggregates

 

For mutations:

- companyInformation_create

- companyInformation_update

- companyInformation_delete

- companyInformation_processings

 

I do not actually know how you can query the current suspension date but I will try to find that for you.

mortenRStrømnes
CONTRIBUTOR **

Great! Thanks, Marius.

Looking forward to hear from you.