문제

I'm just getting started with the Salesforce Web Services API and I'm surprised that there isn't an obvious way to do a query for all e.g. Account objects that contain certain tags.

What would you say is the best way to find all objects that contain certain tags?

I imagine it involves a join on Account.id and AccountTag.id or something similar, but despite some real research, I'm not sure how best to solve this problem.

Thanks in advance!

Update: I guess I could do a select from AccountTag and then get the account objects based on ItemId, but the ideal would be to do a query on Account, with Tags being only one part of the criteria.

도움이 되었습니까?

해결책

You can use the SOQL-R style queries to do this, e.g. this will fetch the account Id and account Name for all the accounts with the internet tag.

select item.id, item.name from accountTag where name='internet'

in this case the item relationship is to the account that was tagged, so you can select any field from the account object through the item relationship path.

See the SOQL-R docs for more info

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top