You need to sign in to do that
Don't have an account?
bprakash
How to use formula fields of related list
I have an account and it has 10 assets,i have a formula field number called support,in apex i want to sort it out so that i can get the max number value on support.
It says that formula fields are decimal so i had given list type as decimal and i sorted that,what i found in the debug log is 0,0,0,0...
I had cleared that one in the loop,Please help me out...
Thanks
Bhanu
SELECT MAX(support__c) FROM Asset WHERE AccountId = :account.Id
Field must be grouped or aggregated: Id at line 9 column 44
its throwing an errror
AggregateResult[] groupedResults = [SELECT MAX(support__c) maxSupport FROM Asset WHERE AccountId = :account.Id];
Object supportObject = groupedResults[0].get('maxSupport');
Double support = Double.valueOf( supportObject );
Illegal assignment from Object to SOBJECT:Asset
Hi
would you like to provide the detail code(visualforce and apex) so that It will be easier to find problem..?
Thanks
asish
i had formula field on asset which is number ,i want to sort this to max value on account.But unfortunately we dont have rollupsmmary on accounts for assets.
Can you suggest how it can be done in apex.
Thanks
Bhanu
http://blog.jeffdouglas.com/2011/08/23/salesforce-trigger-when-rollups-summaries-not-possible/
I'm not sure why this is not working for you, I've ran this and tested it with my sandbox using the Price field. We need to see code to fix the issue