10 Oct’19

D365 GeneralStore ‘Today’s Date’ in a field to use in workflow conditions in MS CRM

Most of us need this in our workflow conditions to check against – to have today’s date handy and then use them in If conditions in workflows. But, the filter in If conditions in workflows don’t let you dynamically select On or after ‘Today’.

And when you want to compare to today’s date on selection of On or After, you are forced to enter a date and not dynamically select Today.

onOrAfterBlank

To overcome this, here’s what you can do to simply store Today’s Date in all records.

Calculated Date and Time field

So workaround this, you can simply create a new Date and Time type of Calculated field to store the current date and use it in your workflow conditions or wherever you need it.
createCalculatedField

Make sure the type of the field is Calculated and then, Edit the criteria.

Select Now() function to set the value of the field.
Now
And the final criteria condition will simply look like the below
finalCriteria

Once you save and publish all your changes, you’ll see that the field is automatically populated with today’s date.
allDatesPopulated.png

Using in Workflow Conditions

Now, you can use the same in the workflow conditions as shown below –

addedCriteria

and you should be able to use this in your workflow conditions which could look like this

addedOnCondition

Hope this quick workaround comes handy!

 

 

Written by

Priyesh Wagh

Sr. Software Developer

Leave a Reply

Your email address will not be published. Required fields are marked *

Want to streamline your business processes?

  • This field is for validation purposes and should be left unchanged.

Recent Articles

  • Introduction to Microsoft Dynamics Commerce Tools

    19 October’ 2019

    As we know, Dynamics 365 Commerce is released in the preview version, So in this blog, we will have a quick explanation ...

    Read more
  • Error Handling Approaches for Integration

    16 October’ 2019

    Introduction: Handling Errors is a best practice in Integration when integrating to keep a track of the Errors that occu...

    Read more
  • Change in URLs for Business Central Tenants

    16 October’ 2019

    Change in base URLs for Business Central SaaS Tenants. I have noticed the Business Central links for Tenants have chan...

    Read more
  • Record Deletion Tool in Business Central

    16 October’ 2019

    Introduction: After a successful Go-Live in Business Central, we somehow need to delete a record from Backend. There is...

    Read more
  • Error “A reference to ‘xyz ‘ is required to compile this module” solution

    10 October’ 2019

    Many of the time while building project/solution we came across the “reference is required to compile this module ...

    Read more
  • We respect your privacy.
  • This field is for validation purposes and should be left unchanged.