Requirement:
Need to send email every 2 hours to Service Request Owner until the status of the SR is not changed.
Please Note:
I am not going to give a step by step solution. I will just discuss the approach and the basic steps that we will need to take. Feel free to let me know your views if you think I am wrong or may be this is not the best approach to accomplish the requirement.
Assumption:
While giving the solution below I am assuming that initial status of Service Request is Open and we need to send the mail until the status is not change from Open to something else
Solution:
- Create an RCR Job that will run every hour. To learn how to create RCR Jobs read this article
- RCR will call a business service that will have following logic
- Query for SR’s with status as Open
- In loop process each SR and evaluate the following condition
While(isSRRecord)
{
CurDate = new Date();
CurTime = CurDate.getTime();
CreatedDate = SRBC.GetFieldValue(“Created”);
CreatedDate = new Date(CreatedDate);
CreatedTime = CreatedDate.getTime();
TotalAge = ( CurTime – CreatedTime) / (1000*60*60)
if (TotalAge > 2)
{
SendEmail to owner
}
} //don’t forget to declare all these variables outside the loop
To find out how to send email through scripting you can read this article


(3 votes, average: 3.67 out of 5)
2 Comments at "Send Email every 2 hours a Case Study"
Neel I believe that this will send the email each hour.
Rectify if I am wrong.
First Time it will send after two hour but after that it will send after each hour
I think you are correct… I didn’t pay much attention to it….
Sorry, Guys will post rectified snippet soon…
Comment Now!