
CRM2016
When a customer (account entity) cancels their contract with us, we set their new_servicestatus to cancelled (new_servicestatus optionset value 2 )
What I would like to do is when the option is set to cancelled, to trigger a scheduled task to deactivate the account on the 10th of the following month
The reason for this is to ensure that the customer is billed for their notice period.
I don't know if I need to put in a field for cancelled and a task is driven from this
I would welcome any advice as to if this can be done and any example code if possible.
*This post is locked for comments
I have the same question (0)Hi Pete,
You can have a workflow sleep (or timeout) until a certain date, but out of the box you can't set the sleep date as "10th of Next Month" - you either need to put in a duration or a specific date. The problem is that you have a relative month.
There is a free add-on I built that will let you do this though - it's called Workflow Elements and it's available from https://kaskela.wordpress.com Install that solution and you'll be able to build your workflow like so:
1) Call activity "Date – Add or Subtract" and pass in the workflow execution date (today), and 1 month. This returns a date time value for a month from now.
2) Call activity "Date - Get Date Components" and pass in the date returned in step one. This has output parameters you'll need in the next step.
3) Call activity "Date - Build Date From Parts" and pass the following parameters, in order to get the 10th of next month.
3a) Day of Month = 10
3b) Month of Year (1 – 12) = (Month of Year (1 – 12) from step 2)
3c) Year = (Year from Step 2)
4) Sleep/Timeout until the date returned in Step 3
5) Deactivate the account
Hope this helps! Let me know if you have any issues. I'd appreciate if you'd mark this as Answering your question.
Thanks,
Aiden