You need to sign in to do that
Don't have an account?
ledap13
Custom Object linking to account
Hi ..
I have a master-detail relationship to my object Order__c and account.
When I ausführe my query:
List <AggregateResult> result = [SELECT Account__c, COUNT (name), SUM (Price__c) total FROM Order__c GROUP BY Account__c];
How do I get through the Account__c field returns the name of the account?
I have a master-detail relationship to my object Order__c and account.
When I ausführe my query:
List <AggregateResult> result = [SELECT Account__c, COUNT (name), SUM (Price__c) total FROM Order__c GROUP BY Account__c];
How do I get through the Account__c field returns the name of the account?
List <AggregateResult> result = [SELECT Account__c, Account__r.Name, COUNT (name), SUM (Price__c) total FROM Order__c GROUP BY Account__c];
To get the value, it would be enough to do something like:
String accountName = record.Account__r.Name;
Regards,
G
I get the following error:
Error: Compile Error: Field must be grouped or aggregated: Name at line 26 column 40
Can you help me?