You need to sign in to do that
Don't have an account?
NewBee21
Getting error while trying to fetch list of open cases related to Account -SOQL Query
public class CaseAccount {
public static void (){
Account accts=[SELECT Id, name FROM Account WHERE Id NOT IN ( SELECT AccountId FROM Case WHERE IsClosed = true ) ] ; } }
Error I am getting :
1.static is not allowed on constructors
2.Invalid constructor name: method
What could be the reason and how do I navigate to solution. Previously I used static in other example and at that time I did not get any erros.
requirement: "Write a class to get the list of all open cases related to an account. Class should have one method with account id as an input parameter and return list of cases
public static void (){
Account accts=[SELECT Id, name FROM Account WHERE Id NOT IN ( SELECT AccountId FROM Case WHERE IsClosed = true ) ] ; } }
Error I am getting :
1.static is not allowed on constructors
2.Invalid constructor name: method
What could be the reason and how do I navigate to solution. Previously I used static in other example and at that time I did not get any erros.
requirement: "Write a class to get the list of all open cases related to an account. Class should have one method with account id as an input parameter and return list of cases
Try Below Class Please Mark It As Best Answer If It Helps
Thank You!
All Answers
Try Below Class Please Mark It As Best Answer If It Helps
Thank You!
But while executing it in anonymous window I am getting following error.
Line: 1, Column: 20
Method does not exist or incorrect signature: void lstCases() from the type AccountRelatedCase
Copy Paste the Whole Code Save It Refresh The Window And Call it From Apex Anonymous Window Like This Please Mark It As Best Answer If It Helps
Thank You!
I have chosen it as THE Best Answer!
Also,could you please kindly suggest me some source so that I understand the SOQL better.I tried Apex basic and database trailhead module but it didn't work for me.