Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Stop a duplicate system job

(0) ShareShare
ReportReport
Posted on by

Hi,

I have a Workflow that is trigger upon an "Appointment date" (custom) field change. If "Appointment date" is changed to 24h in the future, a contact will receive an SMS. 

The problem is when the "Appointment date" is changed more than once, then for each change a system job is created and the previous system job is updated. 

That means if "Appointment date" will be changed 5 times, contact will receive 5 SMS's. The outcome should be to send only the latest system job, that matches all the criteria. 

Any idea of how to achieve this? Tried to look at "Stop workflow", but not sure, how can that resolve it.

All input is appreciated. 

Best,

Rihards

*This post is locked for comments

  • RE: Stop a duplicate system job

    Thanks a lot, I will try this scenario.

  • Suggested answer
    Hussein Wahba Profile Picture
    Hussein Wahba 223 on at
    RE: Stop a duplicate system job

    No need to stop all the jobs and except the desired one,

    but the better strategy is to stop the workflow before proceeding in sending the SMS and when it will not be sent.

    If you cannot control that and you just want to avoid human error in seconds as if the user changed the value 3 times in less than a minute for example and you want to send just the third one it will be a little bit complicated

    You can achieve that by making the SMS workflow as a background process and wait for a while 1 minute for example before sending the SMS.

    and make another realtime workflow or plugin to stop the workflow as the following link it is for CRM 2011 but i think it works fine till the latest version.

    community.dynamics.com/.../crm-2011-how-to-cancel-terminate-workflow-programmatically-using-c

    If you found answer is helpful please mark as verified

  • Suggested answer
    Ben Thompson Profile Picture
    Ben Thompson 6,350 on at
    RE: Stop a duplicate system job

    Your issue at the moment is that each change of date triggers the workflow, sends the SMS and then stops. So just stopping the workflow won't help.

    To solve this you will need to add another (hidden) date field to the entity and after the workflow sends out the SMS add a second step where the hidden date field is updated to the newly updated "appointment date".

    Then prior to the SMS sending step add a check to compare the updated appointment date - 24hrs with the hidden appointment date and if it is less than the hidden date you cancel the workflow.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,430 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans