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

 

OkAvarageGoodVery GoodExcellent (3 votes, average: 3.67 out of 5)
Loading ... Loading ...