My Products
Help
Florian Haase
PARTNER

Joinup / joindown from customerCurrentBalance

by Florian Haase

Hi, 

 

both the query:

query {
useCompany(no:XXXXXXX)
{
customerCurrentBalance
{items
{
joinup_Associate_via_Customer
{
customerNo
}
customerNo
}

}
}
}

or

query {
  useCompany(no:XXXXXXX)
  {
    customerCurrentBalance
    {items
      {
       joindown_Associate_via_CustomerCurrentBalance
        {
          items
          {
            name
          }
        }
        customerNo
      }
    
    }
  }
  }

 

are failing with en sql error:

{
"message": "Error: SQL command no. 3014 failed.",
"path": [
"useCompany",
"customerCurrentBalance",
"items",
0,
"joindown_Associate_via_CustomerCurrentBalance",
"items"
],
"extensions": {
"data": {
"status": 2,
"status_name": "databaseError"
}
}
}

 

even both queries are "valid" due to the GraphiQL Interface.


I can't get both the customerbalance and customerdata in the same query...

 

Florian

5 REPLIES 5
omelhus
PARTNER

by omelhus

There might be some issues in your tenant.

 

This works for me

query CustomerBalance($companyNo: Int) {
  useCompany(no: $companyNo) {
    customerCurrentBalance {
      items {
        joinup_Associate_via_Customer {
          customerNo
        }
        customerNo
      }
    }
  }
}

 

as an alternative you can try the following:

 

query CustomerBalance($companyNo: Int, $customerNumbers: [Int] = []) {
  useCompany(no: $companyNo) {
    customerCurrentBalance {
      items {
        customerNo @export(as: "customerNumbers")
      }
    }
    associate(filter: {customerNo: {_in: $customerNumbers}}) {
      items {
        customerNo
        name
      }
    }
  }
}

 

Florian Haase
PARTNER

by Florian Haase

And even more interesting that the same happens when I go from Associate and run a joindown to the balance. Same error on this tenant, works fine on another.

 

omelhus
PARTNER

by omelhus

Sounds like missing tables in the db. Let’s summon @Arnstein By. Guess he’ll need the company number and/or a trace id.

Arnstein By
VISMA

by Arnstein By

@Florian Haase please send me company number and a trace id and I will see what I can find.

Florian Haase
PARTNER

by Florian Haase

I think you are right Ole, that works fine with another company. Very interesting...