You need to sign in to do that
Don't have an account?
Chad Moutes
Aggregate Function MAX Help
I have an Apex Trigger that is currenty calling upon a MAX function to display the most recent date a Task has been created.
But when I do I recieve the following error: field ActivityDate does not support aggregate operator MAX at line 26 column 42.
Can anyone help me out here?
for(AggregateResult aggregateResult:[SELECT max(createdDate)MaxCDate,WhatId FROM Task WHERE WhatID IN: acc_set AND Status ='Completed' AND Subject ='Completed Call' Group By WhatId]){I want to change the date field that it is referencing from createdDate to ActivityDate like below:
for(AggregateResult aggregateResult:[SELECT max(ActivityDate)MaxCDate,WhatId FROM Task WHERE WhatID IN: acc_set AND Status ='Completed' AND Subject ='Completed Call' Group By WhatId]){
But when I do I recieve the following error: field ActivityDate does not support aggregate operator MAX at line 26 column 42.
Can anyone help me out here?
And then iterate over those accounts to get the highest activity date.
[1] https://success.salesforce.com/ideaView?id=08730000000BqfzAAC
All Answers
And then iterate over those accounts to get the highest activity date.
[1] https://success.salesforce.com/ideaView?id=08730000000BqfzAAC