+ Start a Discussion

expecting semicolon, found ':'


Any idea why would I get this message expecting semicolon, found ':' for the class below




In the line below, there's a ":" after lst_opencase. Should be an "=".


 List<Id> lst_opencase : [SELECT c.OwnerId FROM Case c where c.RecordTypeId = '012300000001mEJAAY'and c.Status !='Closed' and c.Enhancement_Roadmap_Date__c < :dt];



lst_opencase is a list of Case objects, and Case.ownerid is the schema information for the ownerId field on Case, so list_opencase.add(Case.ownerid) doesn't make any sense.


Date dt = System.Date.today();
 List<Case> lst_opencase = [SELECT c.OwnerId FROM Case c where c.RecordTypeId = '012300000001mEJAAY' and c.Status ='Closed' and c.Enhancement_Roadmap_Date__c < :dt];

string[] arryOfIds = new string[lst_opencase.size()];

for(Integer I = 0; i < lst_opencase.size(); i++)

{    arryOfIds.add(lst_opencase[i].Id)}

Messaging.MassEmailMessage mEmail = new messaging.MassEmailMessage();
 Messaging.sendEmail(new Messaging.MassEmailMessage[] { mEmail });


thanks sforce...the code will not work though since you can only send emails to leads,contacts or users..I was able to figure it out