none
CRM 2016: Business Rule - Set to change a field when a date has passed - Works but not automatically

    Question

  • 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?

    Scope:  Entity

    Wednesday, March 15, 2017 2:22 PM

All replies

  • Hi Robin,

    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.

    Thanks


    Sachith Chandrasiri

    Wednesday, March 15, 2017 10:18 PM
  • 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")

    Thursday, March 16, 2017 1:28 PM
  • Hi Robin,

    How are you comparing the sub end date with "Today"? Is "Today" another field you created?? If so how do you populate that field?

    Business Rules does not have a way to compare a date field with current date and time.


    Sachith Chandrasiri

    Friday, March 17, 2017 2:55 AM
  • Sachith,

    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.

    Friday, March 17, 2017 1:27 PM
  • I don't think you can accomplish what you want to do with a Business Rule.  Business Rules are like little snippets of JavaScript code that only execute when you update the record manually.

    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.

    Good Luck!


    Friday, March 17, 2017 7:38 PM
  • What you are trying to achieve is not possible with business rule, either choose a recursive workflow or a daily job to achieve this.

    Ramanathan Rajendran MCTS - Dynamics CRM

    Sunday, March 19, 2017 6:32 AM