Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
Answered

Set Date as today using business roles

Posted on by Microsoft Employee

Hi All, 

i just need the simplest way to set a date field to be NOW when another field's value changes 

i prefer if there is a way using business rules. 

Your help is appreciated 

Thanks

  • ATAAAY Profile Picture
    ATAAAY 6 on at
    Set Date as today using business roles
    You can Set the Date to Modified On so it takes the current date 
     
  • eSBe Profile Picture
    eSBe 95 on at
    RE: Set Date as today using business roles

    It actually does work if you create the Business Rule where if there isn't a value in that field, then it will be set to TODAY. This ensures that when a new record is created and you leave it blank, it will be set to today.

  • Boudewijn Profile Picture
    Boudewijn 47 on at
    RE: Set Date as today using business roles

    @Rory It is ootb, but I find this just a little bit a dirty way to do stuff :) And it does not work when you create a new record

  • Suggested answer
    Rory - Work2B Profile Picture
    Rory - Work2B 30 on at
    RE: Set Date as today using business roles

    Hi,

    I Know it is a old topic but I also ran into this issue. What I've done is created a calculated field "Today' With Now() and setup the dynamics business rule, when it' meets my conditions than I set the field value with this calculated field. So there is no PowerAutomate (Flow) or Java needed.

    Greetings,

    Rory

  • Sumit Desai Profile Picture
    Sumit Desai 66 on at
    RE: Set Date as today using business roles

    can we set hard coded value to the field? if yes then How?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Set Date as today using business roles

    Rabul Tiwari suggestion using a calculated field is not working. The Date field will always show todays date/time.

    I was also looking for a smarter way than workflow but going with a workflow is the best practice, if script is not an option.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Set Date as today using business roles

    Create a new field as Calculated Type

    Data Type Date and Time

    Field Type Calculated and Select edit 

    and in Action 

    Set Field Name to Now();

    Behavior User Local

     

     

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Set Date as today using business roles

    Here is what I did for a similar situation (NO CODE).

    • Created a real time workflow. (To work after a record is created)
    • Check condition, where due date doesn't contain data.
    • Set due date to modified date.

    Please mark as answer, if  this helped.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Set Date as today using business roles

    You can simulate onChange events in your business rules or calculated fields with some creativity.

    Mind that this only works if you want the datetime field to be populated based on one field changing, if you want it to run on multiple possible field changes, it wont work and I wouldnt recommend using below method, because it will create an overkill on fields.

    If there is just one field however, you can copy the old field’s value to a new field (both fields should be of the same type) with a workflow on change of the old field (before change). Create a Calculated Date-Time field, which states if new value of old field does not equal the value of the new field (=change) set the datetime to Now().

  • Tuan Profile Picture
    Tuan 65 on at
    RE: Set Date as today using business roles

    Agree with AlaaMoh89 this should be fixed by MS. Something simple like: when there's no datetime specified in Value, the default datetime is Now datetime.

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

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

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,532 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,501 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans