I am using JsForce to query my orgs salesforce data. I am trying to select all quotes that belong to salespeople from my division. I am very new to SOQL and SalesForce so the best I have come up with is:

SELECT GrandTotal FROM Quote WHERE Owner.Division='Europe'

However this errors with "Did not understand relationship" even though I can see in the salesforce ui that the owner field of a quote has a division attribute. Any help would be appreciated.


1 Answer 1


The reason this query doesn't work is because for Quote, the OwnerId field is polymorphic to both User and Group

So, you need to use a polymorphic query:

SELECT GrandTotal FROM Quote WHERE Owner.Type = 'User' AND Owner.Division='Europe'

Polymorphic query reference

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .