to get a personalized navigation.
to get a personalized navigation.
Hi,
Simple batch_create query/mutation:
mutation batch_create($cid: Int!, $date: Int!, $desc: String!)
{
useCompany(no: $cid)
{
batch_create(
values: [{
valueDate: $date,
description: $desc
}],
suggestValues : {
batchNo: {
type: INTERVAL
from: 1000
to: 99999
}
}
)
{
affectedRows
items
{
batchNo
}
}
}
}
{
"cid": ***,
"date": 20220923,
"desc": "Test"
}
This returns the following:
{
"errors": [
{
"message": " Description: A record with the same primary key already exists.. Status: 3."
}
],
"data": {
"useCompany": {
"batch_create": null
}
},
"extensions": {
"vbnxt-trace-id": "***"
}
}
But the batch is still created. Am I forgetting something, or is this an error in the API?
The batch in VB NXT:
Thank you!
Magnus
Solved! Go to Solution.
We have release a fix to production that should solve your problem.
However, notice that we have deprecated the suggestValues argument in favor of a new way of suggesting values. Please check the documentation here: https://docs.business.visma.net/docs/schema/mutations/inserts#suggested-values. Existing queries will continue to work for a while, but the interval suggestion is only considered for the few columns that support it. The batchNo column is not one of them, so a single suggest value is automatically used instead.
Great! Thank you 🙂
At least one problem is that you cannot actually suggest a value in an interval for batchNo. This is not properly indicated in our API. I will try to see how to make this less error prone.
Thank you for clarifying!
We are investigating this problem and will return with comments as soon as we have a solution.
Copyright © 2022 Visma.com. All rights reserved.