You need to sign in to do that
Don't have an account?
SF_Monkey
soql query with group clause
I am trying to write a soql quey that is very similar to a summary report. I unsure but I believe that I need to group clause in the query.
This is the result that I am trying to achieve
every field on this table is from the same object. I need to group by download_cycle__c and portal_name__c.
here is what I have been written but i cant get the desired result. I have not even attempted to write the lightning component table for it.
Thanks for the help in advance
This is the result that I am trying to achieve
every field on this table is from the same object. I need to group by download_cycle__c and portal_name__c.
here is what I have been written but i cant get the desired result. I have not even attempted to write the lightning component table for it.
select count(Download_Cycle__c), Name, Last_Download__c, Portal_Name__c, count(Portal_URL__c), Password__c, Login__c, Count(Bill_Cycle__c), Location_Address__c, Location_Name__c from vendor_Invoice__c group by Name, Last_Download__c, Portal_Name__c, Password__c, Login__c, Location_Address__c, Location_Name__c
Thanks for the help in advance
https://developer.salesforce.com/docs/component-library/bundle/lightning:treeGrid/example
https://www.soliantconsulting.com/blog/multi-tiered-tables-in-visualforce/
All Answers
Hi,
If this helped solve your issue, please mark as the best answer.You have to order the fields in the Group By clause as the groups you want to have:
Best Regards
I tried this and I got error: "Only date aggregate functions are allowed as grouping expressions: count"
Maybe the best way to do this is to write a "plain" query without any agregations and make the logic in your component.
I do not even how the logic will be implemented in the component since everything will in one row.
https://developer.salesforce.com/docs/component-library/bundle/lightning:treeGrid/example
https://www.soliantconsulting.com/blog/multi-tiered-tables-in-visualforce/
Nested table using pageblock
https://salesforce.stackexchange.com/questions/49545/nested-table-using-pageblock
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_column.htm
I often used breakBefore and that works fine for a VFP.
https://developer.salesforce.com/docs/component-library/bundle/lightning:treeGrid/example
The names in the first column will be either a Download_Cycle__c or a Portal_Name__c (depending of the level of nested data).
Otherwise there are nested accordions probably.
https://developer.salesforce.com/docs/component-library/bundle/lightning:accordion/example#lightningcomponentdemo:exampleAccordionMultiple