This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SOLUTION - PROGRAM MANAGEMENT - Automatic Mail

ratnesh - Friday, May 25, 2012 5:13 AM:

Hello Community,

I want do a task, task is to send a mail to a higher authority when work is not started by the assignee whithin three days after schedule_due_date.

I wrote a method which calculate a difference between due_date and System_date, if differece is 3 or more than 3 and activity state is pending then a mail goes to higher authority.

This mehod is applied on OnAfterUpdate server event of activity2 itemtype. 

Method works fine for a single activity but as i make another new activity in project, method shows a problem (not a single item).

Issues:-

1. if this method runs with server event then everytime, i make changes in activity (make new or update), a mail goes to higher authority.

2. method shows error on creating more then one activity while method has a code to handle more than one activity.

code as given below :-

Normal 0 false false false EN-US X-NONE X-NONE

Innovator inn = this.getInnovator();

Item toUser1 = this.newItem("Activity2","get");

//The above line is to get a itemtype activity2 

if (toUser1.getItemCount() > 0)//count the no. of activities
{
      for (int i=0; i<toUser1.getItemCount(); i++)
  {
     string thisid=toUser1.getItemByIndex(i).getProperty("id");
  //above line is to select id by index of activity 
   toUser1.setAttribute("select","date_due_sched,state");
 //above line is to select due_date and state of activity found above
   
// Here code for finding date difference (system date - due date)
 
 

 if ((difference >= 3 && state=="Pending")

{
  // mail send    
}   
 
3. I want this method to link with a batch file or window service to run it once everyday on particular time.
Is it possible that method automatically calls by a batch file (by task scheduler ) or window services every day on particular time. 
 
Please Help me Out with these problems.
 
Thanks
 
Ratnesh
 
 


 



Brian - Monday, May 28, 2012 8:51 PM:

Hi Ratnesh,

There is already a method callled "Check Escalations" that does, I think, what you want.

The Aras scheduler is a windows service that sends messages to run server methods according to a pre-set schedule. This is a subscriber only tool.

There are community projects that show you how to write a Windows Service. From these you could put your own specific scheduler together.

Regards,

Brian.