0

I am currently in a situation where we have recurring events (Birthday reminders) that send out an email to facilities to buy birthday card.

The email (sent 3 days before) reads like this: Please buy card for person XY since birthday is coming on (current date, not the first instance of the recurring serie).

If I see in my Sharepoint how the system handles the recurring item it shows as start date 2013 (or 14 or 15, according to when it was entered) and as end date 2164.

When in the email I enter the field for the date, if I use the Startdate I get the first instance of the series (ie 2013), if I use enddate, I get 2164.

Is there a way to establish within the workflow or using an extra calculated column in the calendar to tell him to write the current date/year? Is it the best way to approach the problem?

The only workaround I found is to delete past entries of the series so that the workflow restarts and the start date is always the one in next year (which is a tedious job)

  • Not clear what the question is... – Akhoy Jul 21 '15 at 10:31
  • Is there a way to establish within the workflow or using an extra calculated column in the calendar to tell him to write the current date/year? Is it the best way to approach the problem? – susan Jul 21 '15 at 10:32
  • Do you want the workflow to automatically use the current date / year instead of the start date of the recurring series? – Akhoy Jul 21 '15 at 10:35
  • The current date does not equal the 'start date'. The current date is the same day/month but with the current year. – susan Jul 21 '15 at 10:36
  • Did you check this for getting the current date? link. You can then take substring to get current year. – Akhoy Jul 21 '15 at 11:06
1

Recurring events are stored as a single item in the Calendar list and the recurrence information is stored as XML in a hidden field from where recurrence information is calculated. Unfortunately, expanding recurring events is only possible in Server Side Object Model for now.

For eg: For getting events which are coming next:

SPQuery query = new SPQuery();
query.ExpandRecurrence = true;
query.Query = "<Where><DateRangesOverlap><FieldRef Name=\"EventDate\" /><FieldRef Name=\"EndDate\" /><FieldRef Name=\"RecurrenceID\" /><Value Type=\"DateTime\"><Now /></Value></DateRangesOverlap></Where>";

If you want to use recurring events, your only other option would be to get the recurring events using a sandbox solution / farm solution and store the details in a list from where you can fetch results according to the current date in the workflow and show it.

If you are open to other options and are working in an on-premise environment, why not write a timer job to do the same thing? Alternatively, you can also use Pause until Date action in SharePoint designer.

Source: Technet

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.