web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

auto changing status of a record to inactive on a given date

(0) ShareShare
ReportReport
Posted on by 1,703

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)
  • Verified answer
    Aiden Kaskela Profile Picture
    19,696 on at

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans