You need to sign in to do that
Don't have an account?
Jordan@BracketLabs
Record-tagging relationship subquery for tags
I'm trying to run a subquery on my query for a custom object to get it's public and and private tags.
I can't find any documentation about using this relatinoship, but I've activated tagging, and I can query for 'SObjectName__Tag' just fine - I would just prefer not to have to match them up afterward to speed things up on my object creation:
So I'm trying to figure out - I know this is syntactically not correct but hoping it will inspire someone to help me fix my mistakes!
List<SObject> customObjectListWithTags = [SELECT Id,Name, (SELECT Id,Name FROM CustomObject__Task) FROM CustomObject__c];
Thanks...
The actual solution was not to use '__Tags' or '__Tag' in a subquery, I actually was able to use the following subquery:
All Answers
Hi Jordan
You can take help of salesforce_apex_language_reference page number 61 .
I am giving you one of the Examples
for (Account a : [SELECT id, name, (SELECT lastname FROM contacts limit 1)
FROM account WHERE name = 'testAgg']) {
Contact c = a.contacts;
}
The syntax where you are lacking is CustomObject__Task .Don't use this instead use the pural name of the child field .
Please tick the Answer if it solve Your Issue .
The actual solution was not to use '__Tags' or '__Tag' in a subquery, I actually was able to use the following subquery: