Skip to content

Error with SOQL query #20

@jamesloughney

Description

@jamesloughney

The following SOQL query caused an error when it was run:

SELECT Id, ObjectId,Territory2Id, Object.Type, Territory2.Name, Territory2.ParentTerritory2.Name, Territory2.ParentTerritory2.Id, Territory2.Territory2TypeId
FROM ObjectTerritory2Association
WHERE Object.type = 'Account'
ORDER BY ObjectId, LastModifiedDate DESC

This query works fine in the Developer Console.

Here is the error message I received:
Error parsing [select
Id,
Object.Type,
ObjectId,
Territory2.Name,
Territory2.ParentTerritory2.Id,
Territory2.ParentTerritory2.Name,
Territory2.Territory2TypeId,
Territory2Id
from ObjectTerritory2Association
where Object.Type = 'Account']. Error: no viable alternative at input 'Object', no viable alternative at input 'Object'

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions