CRM 2016: Business Rule - Set to change a field when a date has passed - Works but not automatically
I have a Business Rule setup to change a field "Status Reason" to "Expired" when the "Sub End Date" has passed.The Rule works but not like i need it to. I would like the update to happen automatically.
From my screen shots below you will see...
The View shows the "Status Reason" as "Active" and the Sub End Date 3/14/2017 which has passed (so this status reason should be show "Expired")
When you open up the record you see the "Status Reason" field shows "Expired", I have to save the record in order for this to be set and for the View to show "expired".I need field updated to "Expired" and the View to show "Expired", automatically.I have created New data after the business rule was created to test this and still does not happen automatically... So what Am I Missing? Is there some job that needs to be created that would make this happen daily?
There is a property called Scope on the top right corner of the business rule. Set it to "Entity". In this case, we do not need to open the Dynamics CRM form for the business rule to fire. Business rule will fire even if the business rule condition is met by doing an SDK operation via plugin or workflow.
That's what I have. Scope is set to Entity.
Again I have a record that had a 3/15/17 End date and when I just looked at the Subscription View I see the Status Reason still shows "Active" not "Expired" (opening the record the status reason will show "expired")
I appreciate you taking the time to respond to my posts, I need lots of help since i'm new to this. So all the answer you can provide are greatly appreciated.
I created a field called "Today" Date/Time Calculated action of "Now()" so that's where the "today" is coming from within my Condition.
If I can't do this in the rule, how else could I get this to happen? I need field "status reason" to change to "expired" when the sub end date has passed and it would need to happen automatically.
You might want to consider making a background workflow process that will 'wait' the 'sub end date' and if it passes, then change the status of the record then. You'll want to do another condition check to ensure it hasn't already been Expired.
This is where my NON-Experience in this stuff comes into play. I have no idea of what your saying to do. Could you provide a short step by step on what/where I would need to do this in? If you could I would appreciate it, but right now i'm just stuck, I have no idea to get this to work without manually opening up a record and then saving it.
No problem, we've all been there. :)
The first step you already have setup to calculate/set the 'sub end date', so I won't explain that part.
Next, you will create a workflow process. Navigate to Settings, Process and click new to create one. This post explains all the workflow options.
Then take a look at this blog post to see how to set a process timeout:
The second option for 'Process Timeout' is what you want to look at. In your example, you would have the workflow timeout on the 'Sub End date' that the record already has.
- Proposed as answer by Katina Hester Thursday, April 06, 2017 2:44 PM
For creating recursive workflow:
For creating a custom workflow activity which can be used in a workflow:
For daily jobs,
- You can develop a c# console app/service and schedule it in windows local server or azure server.
- You can develop an SSIS package and schedule it.
Ramanathan Rajendran MCTS - Dynamics CRM https://exptechsolutions.blogspot.com/ www.linkedin.com/in/ramanathan-rajendran
- Proposed as answer by Ramanthan Rajendran Sunday, April 09, 2017 5:07 PM