to get a personalized navigation.
to get a personalized navigation.
Hi,
I'm wondering if it is possible to create an order and provided number?
I was trying to do it and I received the following error message: "A record with the same primary key already exists." despite the fact that the order with provided number doesn't exist.
mutation CreateOrder($companyId: Int) {
useCompany(no: $companyId) {
order_create( values: [
{
orderNo: 99,
orderType: 1,
name: "Test order",
orderDateAsDate: "2024-03-10",
customerNo: 99999999,
orgUnit2: 125
}
]) {
affectedRows
items {
orderNo
name
customerNo
orderDateAsDate
}
}
}
}
Response:
{
"errors": [
{
"message": "A record with the same primary key already exists.",
"path": [
"useCompany",
"order_create",
"values/0"
],
"extensions": {
"data": {
"status": 3,
"status_name": "PrimaryKeyAssignmentFailed"
}
}
}
],
"data": {
"useCompany": {
"order_create": {
"affectedRows": 0,
"items": null
}
}
},
"extensions": {
"vbnxt-trace-id": "00000000000000007438f11cafe2fdb3"
}
}
Solved! Go to Solution.
This depends on a setting from the Customer Information table. There is a field called "Next on + only" in English. If you have Order no. checked, then you cannot provide an order number, it can only be assigned by the system.
Copyright © 2022 Visma.com. All rights reserved.