I am writing a query on an object that has a custom relationship to another. I wrote This in the query editor:
Select
OrderNumber,
ImportingBroker__r.Company_Name__c,
ImportingBroker__r.street,
ImportingBroker__r.city,
ImportingBroker__r.state,
ImportingBroker__r.countryCode
from Order where ordernumber ="*ordernumber*"
In the query editor, this executes fine and returns data.
my apex function looks like this:
Order o = [
Select
OrderNumber,
ImportingBroker__r.Company_Name__c,
ImportingBroker__r.street,
ImportingBroker__r.city,
ImportingBroker__r.state,
ImportingBroker__r.countryCode
from Order where ordernumber ="*ordernumber*"] ;
But in the apex editor, it's telling me that there is no relationship "ImportingBroker__r" on the "Order" object, which makes no sense. There is a relation ship named ImportingBroker__c set up, and it does work when executed in the query editor. so whats the deal?