You need to sign in to do that
Don't have an account?
Ken Koellner
SOQL Query parent fields via objectId in ObjectTerritory2Association
Does anyone know if there's a way to get the parent fields for the Account parent object via the ObjectId relationship in ObjectTerritory2Association?
The query below works to get the Name. But I don't know of a way to get the other fields. It's actually one custom field that I'm hoping to get in my query.
select ObjectId , Object.Name, Territory2.MarketUser_Last_Modified_Date__c ,LastModifiedDate
from ObjectTerritory2Association
where Object.Type = 'Account' limit 10
The query below works to get the Name. But I don't know of a way to get the other fields. It's actually one custom field that I'm hoping to get in my query.
select ObjectId , Object.Name, Territory2.MarketUser_Last_Modified_Date__c ,LastModifiedDate
from ObjectTerritory2Association
where Object.Type = 'Account' limit 10
You can try below SOQL query:
Please do let me know if it helps you.
Regards,
Mahesh
The thing is "ObjectId" and the relationship "Object" don't appear to allow getting any Account fields other than Id and Name. What I need is the equivelent of a cast in a program language where the "object" reference could be cast to Account.
Ex
You can add the fields you want from account in the main query.