You need to sign in to do that
Don't have an account?
Brandon
Relationship from Event to Case
Hello,
I'm trying to build a query that finds Events that are tied to Cases and returns some fields from both objects, filtering by the ActivityDate field on the Event object. I don't want to use a Parent-to-Children query -- "Select Status (Select ActivityDate from Events where ActivityDate < 2006-11-10 )" -- because that would return all Cases, whether or not the "where" clause is true.
Is there a way to do this in one query using the Child-To-Parent relationship?
I tried using the "What" relationship, but that points to a Name object. Is there a way to get it to return a Case object? Or will I have to do a manual join with two relationships?
I dream of querying something like:
"SELECT ActivityDate, WhatId, What.Status from Event"
Thanks,
Brandon
I'm trying to build a query that finds Events that are tied to Cases and returns some fields from both objects, filtering by the ActivityDate field on the Event object. I don't want to use a Parent-to-Children query -- "Select Status (Select ActivityDate from Events where ActivityDate < 2006-11-10 )" -- because that would return all Cases, whether or not the "where" clause is true.
Is there a way to do this in one query using the Child-To-Parent relationship?
I tried using the "What" relationship, but that points to a Name object. Is there a way to get it to return a Case object? Or will I have to do a manual join with two relationships?
I dream of querying something like:
"SELECT ActivityDate, WhatId, What.Status from Event"
Thanks,
Brandon
After trying several permutations for your query, the limitation is that Name object aspect. You will need to execute one query and one retrieve and "connect" the results manually.