to get a personalized navigation.
to get a personalized navigation.
How can I identify deleted orders?
Normally I would get a list of all orderNo in visma database and then compare it with my database. But it would take a very long time to loop through to get all orderNo with graphQl when I only get 1000 at a time.
Do you have any solutions for that?
Solved! Go to Solution.
We have come to a possible solution. By first adding a company log definition against table no. 127 (Orders) and column no. 2868 (Order No.) like this:
 
You could get a list of deleted orders from the API by querying companyChangeLog. Example of deleted order:
{
"data": {
"useCompany": {
"companyChangeLog": {
"items": [
{
"primaryKey": "(Ordrenr) 12345678",
}
]
}
}
},
"extensions": {
"vbnxt-trace-id": ""
}
}
This is a very good solution!
by using the field,changedDate, you can also filter on deleted last x number of days
filter:{_and: [{tableNo:{_eq:127}}, {logType: {_eq:4}}]}
Deleted records, including orders, are physically removed. That means you cannot actually query for "what has been deleted?"
At the time being, I don't see any other way than querying all order numbers, and comparing with what you have. Maybe someone from the VB core team could tell you more.
FYI, we are working on providing a way to get notified about events, such as when a record is deleted, but this will come sometime next year.
One "quick fix?" solution could be to add a extra "table" I can query that only gives me a list of all orderNo currently in the order table with no restrictions for number of records returned. (will never be to big or resource-intensive since it will only return integer values and no possibility to join it with other tables).
There are very small chances this could happen, but in any case, it is the responsibility of the VB backend team that owns the data model. GraphQL is only exposing in a query language what they define in the model.
Copyright © 2022 Visma.com. All rights reserved.