Answered by:
Workflow to Set a Date

Question
-
Our organization deals with subscriptions. The subscriptions start on the first day of the month. So if a person pays for a subscription on November 22, 2013 then their subscription will start on December 1, 2013.
Is there a way to capture that process, where if a person pays in the middle of the month that a workflow will update the subscription start date to the 1st day in the next month.Friday, November 22, 2013 6:37 PM
Answers
-
It would need to be done using a custom workflow activity, or plugin. Something like this:
var today = DateTime.Today; DateTime start = new DateTime(today.Year, today.Month, 1); if (today.Day > 1) { start.AddMonths(1); } // Update the record or return value to workflow
Hope that helps
Paul
If my response helped you find your answer please show your thanks by taking the time to "Mark As Answer" and "Vote As Helpful".
- Marked as answer by HIMBAPModerator Sunday, November 24, 2013 2:25 PM
Friday, November 22, 2013 8:03 PM -
I have a free WF Assembly for Date/Time operations. Check it out - http://wfdatetimeutilities.codeplex.com/
Blake Scarlavai - http://mscrmdev.blogspot.com/ - Sonoma Partners - http://www.sonomapartners.com/ - Follow @bscarlav
CRM 2011 JavaScript Model Generator - CRM 2011 Appender for log4net- Marked as answer by HIMBAPModerator Sunday, November 24, 2013 2:25 PM
Sunday, November 24, 2013 12:39 AM
All replies
-
It would need to be done using a custom workflow activity, or plugin. Something like this:
var today = DateTime.Today; DateTime start = new DateTime(today.Year, today.Month, 1); if (today.Day > 1) { start.AddMonths(1); } // Update the record or return value to workflow
Hope that helps
Paul
If my response helped you find your answer please show your thanks by taking the time to "Mark As Answer" and "Vote As Helpful".
- Marked as answer by HIMBAPModerator Sunday, November 24, 2013 2:25 PM
Friday, November 22, 2013 8:03 PM -
Thank you Paul. I will use this template. Thank you for your help.Friday, November 22, 2013 8:40 PM
-
I have a free WF Assembly for Date/Time operations. Check it out - http://wfdatetimeutilities.codeplex.com/
Blake Scarlavai - http://mscrmdev.blogspot.com/ - Sonoma Partners - http://www.sonomapartners.com/ - Follow @bscarlav
CRM 2011 JavaScript Model Generator - CRM 2011 Appender for log4net- Marked as answer by HIMBAPModerator Sunday, November 24, 2013 2:25 PM
Sunday, November 24, 2013 12:39 AM