You need to sign in to do that
Don't have an account?
Hartley
Error trying to get data from Custom Object
Hello,
Thanks for taking the time to help me or look into my issue.
I seem to be getting an error when attempting a simple SELECT query in my lightning App. I know the issue is with the Custom Object as if I change the table and List to a different object I can get the data.
The following is the code:
public class StudentRosterListController {
@AuraEnabled
public static List<custom_object__c> getStudents(){
return [SELECT Id, Name FROM custom_object__c];
}
}
And here is the error message:
"message": "An internal server error has occurred\nError ID: 1148389056-13703 (408822391)"
Again if I replace the custom_object__c with different objects it works for somes and doesn't for others. Any help is greatly appreciated, thank you.
Thanks for taking the time to help me or look into my issue.
I seem to be getting an error when attempting a simple SELECT query in my lightning App. I know the issue is with the Custom Object as if I change the table and List to a different object I can get the data.
The following is the code:
public class StudentRosterListController {
@AuraEnabled
public static List<custom_object__c> getStudents(){
return [SELECT Id, Name FROM custom_object__c];
}
}
And here is the error message:
"message": "An internal server error has occurred\nError ID: 1148389056-13703 (408822391)"
Again if I replace the custom_object__c with different objects it works for somes and doesn't for others. Any help is greatly appreciated, thank you.
I actually just figured it out by ensuring Debug mode was set and viewiing the log file in the Dev Console when loading the page. My issue was due to a Limit size that I was unaware of when attempting to do Aggregation on the DB. I was way over the 50k limit, and so will need to look into implementing pagination using LIMIT and OFFSET. When I set the LIMIT in the query using the Custom Object then the data is displayed. Thank you very much for attempting to assist me.
All Answers
your apex method and SOQL query both are correct, can you share your lightning component with controller OR helper where you call that apex method so i review your problem.
thanks
I actually just figured it out by ensuring Debug mode was set and viewiing the log file in the Dev Console when loading the page. My issue was due to a Limit size that I was unaware of when attempting to do Aggregation on the DB. I was way over the 50k limit, and so will need to look into implementing pagination using LIMIT and OFFSET. When I set the LIMIT in the query using the Custom Object then the data is displayed. Thank you very much for attempting to assist me.