You need to sign in to do that
Don't have an account?
Sheena Querido
Apex Class - Group by Error: Illegal Assignment from List to List
I tried creating a GROUP BY clause in my Apex Class, but I'm getting an error message that Line 9 has Illegal Assignment form List to List
Where Line 9 is:
Entire Apex Class is:
Where Line 9 is:
customerproducts = [SELECT Description_for_Invoice__c,TSDF_Approval_Number__c,Caveats__c,Category__c,Container_Size__c,UM__c,Price__c
Entire Apex Class is:
public class ExhibitAController { public Customer_Pricing__c cust {get;set;} public List<Customers_Product_Code__c> customerproducts {get;set;} public ExhibitAController(ApexPages.StandardController stdController){ this.cust = (Customer_Pricing__c)stdController.getRecord(); customerproducts = [SELECT Description_for_Invoice__c,TSDF_Approval_Number__c,Caveats__c,Category__c,Container_Size__c,UM__c,Price__c FROM Customers_Product_Code__c where Customer_Pricing__c =:cust.Id GROUP BY Description_for_Invoice__c,TSDF_Approval_Number__c,Caveats__c,Category__c,Container_Size__c,UM__c,Price__c ORDER BY Category__c, Description_for_Invoice__c, Container_Size__c] ; } }
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_SOQL_agg_fns.htm