You need to sign in to do that
Don't have an account?
Archon
Relationship query for task and lead
I am trying to write a relationship query that will pull tasks along with the associated lead and owner. I have a current query in production that works, but using sforce explorer returns an error that says "Query Failed: Length cannot be less than zero. Parameter name: length" Does anyone know what this error indicates?
This is my current query that works:
SELECT Id,
Subject,
ActivityDate,
Who.FirstName,
Who.LastName,
What.Name,
Status,
Priority
FROM TASK
WHERE Owner.Email = '<email of owner>'
ORDER BY Priority
I'm trying to rewrite this to return values from the associated lead such as the lead id. But, like I said, even the working production query is giving errors in sforce explorer. The service url I am using is https://www.salesforce.com/services/Soap/u/10.0. I tried using 9.0 and 8.0 and it still gives the same error.
This is my current query that works:
SELECT Id,
Subject,
ActivityDate,
Who.FirstName,
Who.LastName,
What.Name,
Status,
Priority
FROM TASK
WHERE Owner.Email = '<email of owner>'
ORDER BY Priority
I'm trying to rewrite this to return values from the associated lead such as the lead id. But, like I said, even the working production query is giving errors in sforce explorer. The service url I am using is https://www.salesforce.com/services/Soap/u/10.0. I tried using 9.0 and 8.0 and it still gives the same error.
Hi,
The ‘Who” reference of a Task may be an Contact or Lead.
So if a specific Task is related to a Lead it will return Lead Id if you add ‘Who.Id’ in the SOQL. But from this SOQL relationship you can not get any further information related lead such as Lead Country or Lead Phone no.
Thanks,
Dinesh Nasipuri