You need to sign in to do that
Don't have an account?
Lakshman
Send Email every 3 months to specific user depending on a particular scenario
Hi All,
I have a requirement where I need to Send Email to fixed users on following conditions:
1. I have a field on Account named PublishDate__c which is of type Date.
2. I need to Send email to Users(which are fixed) after every three months from this Date, so it would be like: we will send email after 3 months from this date and then after 6 months then 9 and so on.
How can we achieve this, through Scheduler would it be possible? If yes how and if no then is there any other way out?
Please help me on this.
Regards,
Lakshman
Well I have figure it out, the query would be like follows:
public Date d = system.today().addMonths(-3);
String query = 'Select Id, PublishDate__c From Account where PublishDate__c =:d';
Thanks!
Regards,
Lakshman
All Answers
Hi Lakshman,
Yes a scheduled batch job would be the best bet for you. In you code you can have to
Hope this helps.
How would be the query?
Would it be like:
Database.query('Select Id, PublishDate__c From Account where (PublishDate__c + 90) =:today()');
the above query gives me an erroe like unexpected token 90.
I appreciate if you can tell me the query.
Thanks
Regards,
Lakshman
Well I have figure it out, the query would be like follows:
public Date d = system.today().addMonths(-3);
String query = 'Select Id, PublishDate__c From Account where PublishDate__c =:d';
Thanks!
Regards,
Lakshman