We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to create a recurring task?

There doesn’t seem to be an example on the docus

Hi Albert,


Thank you for writing to Aspose support team.

We provide option to update and read the recurring tasks as follows:

Update Recurring Task

<span style=“font-size: 10pt; font-family: “Courier New”;”>Project project = <span style=“font-size:10.0pt;font-family:
“Courier New”;mso-fareast-font-family:“Times New Roman”;color:#000091”>new<span style=“font-size: 10pt; font-family: “Courier New”;”> Project(<span style=“font-size:10.0pt;font-family:“Courier New”;
mso-fareast-font-family:“Times New Roman”;color:#009100”>“TestRecurringTask2010.mpp”<span style=“font-size: 10pt; font-family: “Courier New”;”>); <span style=“font-size:10.0pt;font-family:“Courier New”;
mso-fareast-font-family:“Times New Roman”;color:gray”>// attached test project
with recurring task<o:p></o:p>

Task task = project.RootTask.Children.GetById(1);

task.RecurringInfo.Occurrences = 15;

project.Save("saved.mpp", SaveFileFormat.MPP);



Read Recurring Task

Project project = new Project("TestRecurringTask.mpp");

Task task = project.RootTask.Children.GetById(1);

Assert.IsNotNull(task.RecurringInfo, "RecurringInfo cannot be null");

Assert.AreEqual(RecurrencePattern.Weekly, task.RecurringInfo.RecurrencePattern, "RecurrencePattern");

Assert.AreEqual(new DateTime(2015, 4, 14, 8, 0, 0), task.RecurringInfo.StartDate, "StartDate");

Assert.AreEqual(new DateTime(2015, 6, 24, 0, 0, 0), task.RecurringInfo.EndDate, "EndDate");

Assert.AreEqual(project.GetDuration(2), task.RecurringInfo.Duration, "Duration");

Assert.AreEqual(5, task.RecurringInfo.Occurrences, "Occurrences");

Assert.AreEqual(WeekdayType.Monday | WeekdayType.Tuesday | WeekdayType.Wednesday, task.RecurringInfo.WeeklyDays, "WeeklyDays");

Assert.AreEqual(10, task.RecurringInfo.WeeklyRepetitions, "WeeklyRepetitions");

task = project.RootTask.Children.GetById(7);

Assert.IsNotNull(task.RecurringInfo, "RecurringInfo cannot be null");

Assert.AreEqual(RecurrencePattern.Monthly, task.RecurringInfo.RecurrencePattern, "RecurrencePattern");

Assert.AreEqual(new DateTime(2015, 4, 14, 8, 0, 0), task.RecurringInfo.StartDate, "StartDate");

Assert.AreEqual(new DateTime(2015, 6, 25, 17, 0, 0), task.RecurringInfo.EndDate, "EndDate");

Assert.AreEqual(project.GetDuration(1), task.RecurringInfo.Duration, "Duration");

Assert.AreEqual(1, task.RecurringInfo.Occurrences, "Occurrences");

Assert.IsTrue(task.RecurringInfo.MonthlyUseOrdinalDay, "MonthlyUseOrdinalDay");

Assert.AreEqual(WeekdayType.None, task.RecurringInfo.WeeklyDays, "WeeklyDays");

Assert.AreEqual(OrdinalNumber.Third, task.RecurringInfo.MonthlyOrdinalNumber, "MonthlyOrdinalNumber");

Assert.AreEqual(DayOfWeek.Wednesday, task.RecurringInfo.MonthlyOrdinalDay, "MonthlyOrdinalDay");

Assert.AreEqual(2, task.RecurringInfo.MonthlyOrdinalRepetitions, "MonthlyOrdinalRepetitions");

task = project.RootTask.Children.GetById(10);

Assert.IsNotNull(task.RecurringInfo, "RecurringInfo cannot be null");

Assert.AreEqual(RecurrencePattern.Yearly, task.RecurringInfo.RecurrencePattern, "RecurrencePattern");

Assert.AreEqual(new DateTime(2015, 4, 14, 8, 0, 0), task.RecurringInfo.StartDate, "StartDate");

Assert.AreEqual(new DateTime(2017, 6, 30, 0, 0, 0), task.RecurringInfo.EndDate, "EndDate");

Assert.AreEqual(project.GetDuration(24, TimeUnitType.Hour), task.RecurringInfo.Duration, "Duration");

Assert.AreEqual(3, task.RecurringInfo.Occurrences, "Occurrences");

Assert.IsTrue(task.RecurringInfo.YearlyUseOrdinalDay, "YearlyUseOrdinalDay");

Assert.AreEqual(WeekdayType.None, task.RecurringInfo.WeeklyDays, "WeeklyDays");

Assert.AreEqual(OrdinalNumber.Last, task.RecurringInfo.YearlyOrdinalNumber, "YearlyOrdinalNumber");

Assert.AreEqual(DayOfWeek.Friday, task.RecurringInfo.YearlyOrdinalDay, "YearlyOrdinalDay");

Assert.AreEqual(Month.June, task.RecurringInfo.YearlyOrdinalMonth, "YearlyOrdinalMonth");


I am afraid that currently we don't support creating a new recurring task. I have logged request for this new feature under Id: TASKSNET-1720 for further investigation by the product team. Although it may not be implemented in the near future as many high priority tasks are there in queue for processing. I shall write here as soon as some feedback is received in this regard.

The issues you have found earlier (filed as TASKSNET-1720) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by kashif.iqbal