to get a personalized navigation.
to get a personalized navigation.
We are trying to create new product with new category.
Product have multiple barcodes and multiple prices like regular price and special price.
Can we create everything in one request?
Solved! Go to Solution.
How dynamic can you build the query? By using the @export directive you can force the queries to run sequentially. I'm not sure where to stick the extra eanItemNos though.
mutation CreateProductWithGroup($cid: Int!, $cat: Int, $productNo: String) {
useCompany(no: $cid) {
productCategory_create(
values: [{description: "demodemo"}]
suggest: {productCategoryNo: true}
) {
items {
productCategoryNo @export(as: "cat")
}
}
product_create(
values: [{productNo: "1234-tes2t", description: "product description", productCategoryNo1: $cat, eanItemNo: "9999999999999"}]
) {
items {
productNo @export(as: "productNo")
}
}
priceAndDiscountMatrix_create(
values: [{productNo: $productNo, salesPrice1InCurrency: 123}, {productNo: $productNo, salesPrice1InCurrency: 99, customerPriceGroup1: 2}]
) {
affectedRows
items {
productNo
salesPrice1InCurrency
customerPriceGroup1
}
}
}
}
Copyright © 2022 Visma.com. All rights reserved.