• LeeMurphy
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies

I'm trying to create an email template that will be scheduled to send every few days. The hurdle I need to overcome is that the email needs to list several cases.

 

We have a custom datetime field in cases called FeedbackDate, and this email needs to have a list of all case IDs whose FeedbackDate field is five days or more before the current date (and a few other criteria but once i know howto go about filtering and sorting I can work that out).

 

My question is, where do I start? How would you go about this? Is it possible to do just in the email template, or do I need to use apex?

 

Cheers for any pointing in the right direction

I'm fairly new to apex and only have experience with c# and VB, so apologies if this is a simpleton question.

 

I have a field called Feedback Email Sent Date (which intuitively is the datetime value a feedback email was sent), and I want to write a piece of code that checks for all cases where this value is 3 days or more ago. So far I have:

 

      Datetime daysago = now().addDays(-3);
      
      Case[] c = [SELECT Id, Feedback_Email_Sent_Date__c FROM Case WHERE Feedback_Email_Sent_Date__c >= daysago];

 I am currently getting an error saying daysago is an invalid token, how can I fix this?

 

Also, I would also like to ignore all records where the feedback sent date field is blank (meaning we haven't sent a feedback email), is there a simple way of doing this too?

 

Cheers for any help :)

I have a custom button which is supposed to send an email, but I'm getting the following error when I click it:

"A problem with the OnClick JavaScript for this button or link was encountered: missing ; before statement"

My button executes the following OnClick Javascript:

{!REQUIRESCRIPT("/soap/ajax/23.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/23.0/apex.js")}

Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();

mail.setTargetObjectId({!Case.AccountId});
mail.setTemplateId('00XD0000001SLYh');
mail.setBccSender(false);
mail.setToAddresses({!Case.SuppliedEmail});
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
}

 
I can't see a missing semicolon?
Someone please shed some light on this for me as I can't move forward until this is resolved.

I'm fairly new to apex and only have experience with c# and VB, so apologies if this is a simpleton question.

 

I have a field called Feedback Email Sent Date (which intuitively is the datetime value a feedback email was sent), and I want to write a piece of code that checks for all cases where this value is 3 days or more ago. So far I have:

 

      Datetime daysago = now().addDays(-3);
      
      Case[] c = [SELECT Id, Feedback_Email_Sent_Date__c FROM Case WHERE Feedback_Email_Sent_Date__c >= daysago];

 I am currently getting an error saying daysago is an invalid token, how can I fix this?

 

Also, I would also like to ignore all records where the feedback sent date field is blank (meaning we haven't sent a feedback email), is there a simple way of doing this too?

 

Cheers for any help :)