We want to Schedule Document Reminder for 100 days past current date.
I created a Date variable called “ReminderDate” <%#Variable.ReminderDate%> in the workflow, and then used c# code that I found on the help site to calculate # days out past that date. (For testing I used 1 as the number of days.)
var current = DateTime.Today;
var daysToAdd = 1;
for (var i = 0; i < daysToAdd; i++){
if(current.DayOfWeek != DayOfWeek.Friday){
current = current.AddDays(1);
} else{
current = current.AddDays(3);
}
}
return current;
However, I am getting an error message: Couldn't update '1/1/1900 12:00:00 AM': Not a variable, and not an xml variable. Since this creates the date as 1/1/1900, the Schedule Document Reminder task spits out an error - “Reminder can't be scheduled in the past.”.
Can someone help out on this one?
I tried similarly to calculate an Expiration Date but got the same error, so guessing that it is something in the c#.
(Created the variable in the workflow - not stored as an attribute or anything like that)