You need to sign in to do that
Don't have an account?
Vijaya Kumar Reganti
How to query on opportunityLineItem to get the Opportunity.territory field from opportunity
Hi Friends,
I have a requirement to do the following query.
[Select Opportunity.Territory from OpportunityLineItem]
When I have tried this, I am getting an error like there is no entity "Territory" on "Opportunity" Object.
Please help in this regard.
Thanks,
Vijay
Hi Friends,
Finally i got my answer.To get the territory name,
[Select Opportunity.Territory from OpportunityLineItem]
instead of the above query I have used [Select Opportunity.Territory.Name from OpportunityLineItem]
It Worked.
Thanks,
Vijay
All Answers
I don't believe that territory is a regular field - check out this thread on accessing the territory of an account - I'd expect a similar pattern for opportunities:
http://boards.developerforce.com/t5/Apex-Code-Development/how-do-i-get-the-territory-for-an-account-in-apex-api/td-p/84825
Hi Friends,
Finally i got my answer.To get the territory name,
[Select Opportunity.Territory from OpportunityLineItem]
instead of the above query I have used [Select Opportunity.Territory.Name from OpportunityLineItem]
It Worked.
Thanks,
Vijay