My Products
Help
Florian Haase
PARTNER

Orderline - description "å"

by Florian Haase

Followin mutation: 

 

{mutation {
useCompany(no: 4655191) {
orderLine_create(values: [{
orderNo: 1736
lineNo: 1
productNo: "TEQ1001"
processingMethod2: 81920
processingMethod1: 0
processingMethod4: 262144
quantity: 1
priceInCurrency: 9999
},
{
orderNo: 1736
lineNo: 2
productNo: "TEQ1"
structureLevel: 1
processingMethod2: 16385
description: "Eldøyane Camp Aker, Eldøyane, Stord, Norge-"Busshålo", Stord, Norge"
processingMethod1: 4096
quantity: 1
orgUnit1: 3131
transactionInformation1: "TB-032193-S01-N002"
transactionInformation2: "STD"
structureHeadLineNo: 1
priceInCurrency: 9999
},
{
orderNo: 1736
lineNo: 3
productNo: "TEQTurInf"
processingMethod2: 422330368
memoNo: 1538
}])
{
affectedRows,
items {

orderNo
lineNo
description
changedByUser
changedDateTime
}
}
}
}}

 Results in:

{"Error parsing query: Unexpected character \"å\""}

 

What is the right way to send "å"?

 

 

 

 

 

3 REPLIES 3
Accepted solution
Marius Bancila
VISMA

by Marius Bancila

It works for me:

mutation new_order_with_quotes($cid : Int, $ono : Int = 0)
{
  useCompany(no: $cid)
  {
    order_create(values :[{
      orderDate : null
    }])
    {
      affectedRows
      items
      {
        orderNo @export(as : "ono")
      }
    }
    
    orderLine_create(values : [
      {
        orderNo : $ono
        productNo : "101"
        description : "sample with \"quotes\""
      }
    ])
    {
      affectedRows
      items
      {
        orderNo
        lineNo
        description
      }
    }
  }
}

The response:

{
  "data": {
    "useCompany": {
      "order_create": {
        "affectedRows": 1,
        "items": [
          {
            "orderNo": 1058
          }
        ]
      },
      "orderLine_create": {
        "affectedRows": 1,
        "items": [
          {
            "orderNo": 1058,
            "lineNo": 1,
            "description": "sample with \"quotes\""
          }
        ]
      }
    }
  },
  "extensions": {
    "vbnxt-trace-id": "000000000000000032440f34c79a852b"
  }
}

Result in front-end:

MariusBancila_0-1695363418618.png

 

Florian Haase
PARTNER

by Florian Haase

Sorry, I did see this first now that we have some " in the text. The question is more how to escape these " in correct way...

omelhus
PARTNER

by omelhus (Updated ‎18-09-2023 23:55 by omelhus PARTNER )

Send the whole object as a variable. The only way.

 

mutation CreateOrderLines($input: [OrderLine_Input]!) {
  useCompany(no: 4655191) {
    orderLine_create(values: $input) {
      affectedRows
      items {
        orderNo
        lineNo
        description
        changedByUser
        changedDateTime
      }
    }
  }
}

{
  "input": [
    {
      "orderNo": 1736,
      "lineNo": 1,
      "productNo": "TEQ1001",
      "processingMethod2": 81920,
      "processingMethod1": 0,
      "processingMethod4": 262144,
      "quantity": 1,
      "priceInCurrency": 9999
    },
    {
      "orderNo": 1736,
      "lineNo": 2,
      "productNo": "TEQ1",
      "structureLevel": 1,
      "processingMethod2": 16385,
      "description": "Eldøyane Camp Aker, Eldøyane, Stord, Norge-\"Busshålo\", Stord, Norge",
      "processingMethod1": 4096,
      "quantity": 1,
      "orgUnit1": 3131,
      "transactionInformation1": "TB-032193-S01-N002",
      "transactionInformation2": "STD",
      "structureHeadLineNo": 1,
      "priceInCurrency": 9999
    },
    {
      "orderNo": 1736,
      "lineNo": 3,
      "productNo": "TEQTurInf",
      "processingMethod2": 422330368,
      "memoNo": 1538
    }
  ]
}