You need to sign in to do that
Don't have an account?
Austin Gutz
Aggregate/Order/Count SOQL Data
I have the following query:
Customer - Meeting
Customer - Meeting
Customer - Email
Lead - Contact
Lead - Contact
Lead - Contact
I'm trying to find a way to group and count the results. So something like this
Customer - Meeting 2
Customer - Email 1
Lead - Contact 3
Normally I could achieve this using a summary report and pull that information into the Conga template but the users running the merge don't have access to export reports so I have to use queries.
SELECT Completed_Date__c, CreatedDate, Description, Subject__c, Account.Name, Account.Status__c,CreatedBy.Name, Owner.Name FROM Task WHERE Completed_Date__c = LAST_WEEK AND ( Subject__c LIKE '%Customer%' OR Subject__c LIKE '%Lead%' ) AND Owner.Name = 'Employee Name'This query pulls all tasks associated with Owner.Name = 'Insert Employee Name'. I'm then using the result to populate a Conga Word table that displays the task Subject. The problem is the results look like this:
Customer - Meeting
Customer - Meeting
Customer - Email
Lead - Contact
Lead - Contact
Lead - Contact
I'm trying to find a way to group and count the results. So something like this
Customer - Meeting 2
Customer - Email 1
Lead - Contact 3
Normally I could achieve this using a summary report and pull that information into the Conga template but the users running the merge don't have access to export reports so I have to use queries.
I am not sure but plz check once below query :
Thanks
Varaprasad
1.) I keep getting an error that the query must start with SELECT. Am I doing something wrong?
2.) I have a custom link that is clicked that runs this and a few other queries. My link captures &Id={!$User.Id} - How can I pass that id to Owner.id = in my queries?
I tried
but get an error of incorrect id type.
*This is maybe my 3rd-day using SOQL so I apologize if these are stupid questions!