Free Support Forum - aspose.com

Exception : class com.aspose.email.system.exceptions.ArgumentException: The start date should be less than the date completed

Hi,

Trying to add task to the PST with
Start date : Mon Aug 10 05:00:00 UTC 2015
Complete date : Tue Aug 11 05:00:00 UTC 2015
Due date : Mon Aug 10 05:00:00 UTC 2015

And monthly recurring , every 12 of each month

And getting this :

class com.aspose.email.system.exceptions.ArgumentException: The start date should be less than the date completed.

com.aspose.email.MapiTask.b(SourceFile:510)

com.aspose.email.MapiTask.setRecurrence(SourceFile:601)


Please advise.

Thanks

Hi,


Thank you for posting your inquiry.

Please share your sample Task message with us so that we can investigate the issue at our end and assist you further.

Hi,

I don’t have such a message, I have data coming from exchange server (Office 365) and trying to insert it to the PST. I can create a sample code with those dates , will this helps ?

Thanks

Hi,

Please the code that reproduce the exception :

PersonalStorage pst = PersonalStorage.create("file.pst", FileFormatVersion.Unicode);

FolderInfo tmpFolder = pst.createPredefinedFolder("Tasks", StandardIpmFolder.Tasks);

Date startDate = new Date();

Date dueDate = new Date();

Calendar tmpCal = Calendar.getInstance();

tmpCal.add(Calendar.DAY_OF_MONTH, -1);

final MapiTask tmpTask = new MapiTask("Task 1", "Task 1 body", startDate , dueDate);

tmpTask.setDateCompleted(tmpCal.getTime()); //Complete a day before current date

tmpTask.setPercentComplete(100);

tmpTask.setStatus(MapiTaskStatus.Complete);

final MapiCalendarMonthlyRecurrencePattern montlyRec = new MapiCalendarMonthlyRecurrencePattern();

montlyRec.setPatternType(MapiCalendarRecurrencePatternType.Month);

Calendar cal = Calendar.getInstance();

montlyRec.setDay(cal.get(Calendar.DAY_OF_MONTH)); //Recurrency day is current day of the month, i.e. one day after the completion date

montlyRec.setPeriod(1);

montlyRec.setEndType(MapiCalendarRecurrenceEndType.NeverEnd);

tmpTask.setRecurrence(montlyRec); //Here the exception

tmpFolder.addMapiMessageItem(tmpTask);


Thanks

Hi,


Thank you for providing the sample code.

It seems that this task message has issues, as if we try to create similar task using Outlook 2013, having monthly recurrence and having completion date one day prior to the task start date, then either the task completion date is set to None or recurrence is dropped. It is not possible to create a task in Outlook 2013 having endless monthly recurrence and task completion date one day prior to the task start date.

On the other hand, if you set task properties properly, like start date is earlier than the completion date, then this code works fine.

You may please consider these facts before adding such task into PST and please feel free to share your feedback with us in case you have further queries in this regard.

Thanks. I\ll check again.

Btw, is outlook I can set recurrency start date and it could be different from task start date, how can I do that in your library ?

Thanks

Hi,

Seems that office 365 allows creation of all such tasks, please see the attached picture.
You can create task with start and due date same, completion day after and recurrency monthly, same day without end date.
I have many of this coming from office 365 so please advise.

Thanks

Please see additional task that I’ve created in the attached pictures, one is before save task and second is after. In Office 365 all possible and I think you need to support this and not tell that such task is not possible.

Thanks

Hi,


Thank you for providing more supporting data. I have logged this issue under Id:EMAILJAVA-33533 in our bug reporting system for further investigation by the product team. I shall write here as soon as some feedback is received in this regard.

The issues you have found earlier (filed as EMAILJAVA-33533) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.