Reply
Regular Contributor
knight
Posts: 33
0

expecting semicolon, found ':'

[ Edited ]

 

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

 

 ;
 

Contributor
Pinnacle-Aaron
Posts: 3
0

Re: expecting semicolon, found ':'

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];

 


Moderator
SimonF
Posts: 8,016
0

Re: expecting semicolon, found ':'

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.

Cheers
Simon
docs | blog | twitter
Trusted Contributor
sforce2009
Posts: 213
0

Re: expecting semicolon, found ':'

[ Edited ]

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();
 mEmail.setTargetObjectIds(arrayOfIds);
 mEmail.setReplyTo('test@test.com');
 mEmail.setSaveAsActivity(false);
  mEmail.setTemplateId('00X300000017Ybx');
 Messaging.sendEmail(new Messaging.MassEmailMessage[] { mEmail });

-Srinivas
http://salesforcetrekbin.blogspot.com/
www.trekbin.com
Regular Contributor
knight
Posts: 33
0

Re: expecting semicolon, found ':'

[ Edited ]

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