You need to sign in to do that
Don't have an account?
Jay Weerappulige
Aggregate values of a formula filed group by lookup filed
I am quite new to Apex. I have a object with formula number filed I want to fet SUM of that filed group by Lookup filed. It doesn't work with SOQL query. I need to write a class and return tha data and display on a community lightnning page if the login user is the contact person of the record. I have develped the community page. The problem i have to writing the Apex controller.
You can use GROUP BY on a lookup up field. For Example, the following query will work:
When your GROUP BY field is a standard lookup field: OR:
With your GROUP BY field is a custom field:
Can you please post the SOQL query you are using.
Regards,
Sagar Wahal
Regards,
Jay Weera