web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Set a field to Today() - a Changing date based on the current date

(0) ShareShare
ReportReport
Posted on by

I’m looking create a field on a form that updates continually based on the current time. I want this because I could then create rules and workflows off due dates, reminder dates, start dates, etc. These workflows would change the fields on the same or other entities.

 

For example if a task due date is greater than TODAY() then set field value to “Needs Update”

I was looking at the equations but they are limited on functionality – Perhaps there is a tool pack download that has excel functions like this or a workaround?

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    RE: Set a field to Today() - a Changing date based on the current date

    Create a calculated field.

    Leave the CONDITION blank.

    Set the Action to: "Set [fieldname] TO Now()"

  • Alina2015 Profile Picture
    on at
    RE: Set a field to Today() - a Changing date based on the current date

    4. Use CRM 2015 Calculated field to set calculated  date

    Could you please explain how to use calculated fields in 2015 to set current date?

    Thank you.

  • Suggested answer
    Mahadeo Matre Profile Picture
    17,021 on at
    RE: Set a field to Today() - a Changing date based on the current date

    In that case

    1. you can use recurring workflow, which will update date on those records once a day..

    Or

    2.  Create console application which will update date on this entity using CRM SDK and schedule application in windows task to run every day..

    Or

    3.  Create SSIS package to update date on this entity and schedule SSIS package using SQL server.

    Or

    4. Use CRM 2015 Calculated field to set calculated  date

    Hope this will work

  • Theohox13 Profile Picture
    on at
    RE: Set a field to Today() - a Changing date based on the current date

    i will be running a report and the report will be scanning what accounts havent been visited. the date change must happen automatic without any intervention

  • Theohox13 Profile Picture
    on at
    RE: Set a field to Today() - a Changing date based on the current date

    can you chnage it to on CRM load?

  • Theohox13 Profile Picture
    on at
    RE: Set a field to Today() - a Changing date based on the current date

    the form will not be touched after is it created

  • Mahadeo Matre Profile Picture
    17,021 on at
    RE: Set a field to Today() - a Changing date based on the current date

    Hi..

    you can create one custom attribute for your entity if you dont have for date.. and set attribute value on form load using code Prashant gave.

    So that whenever that form is opened, you will see updated date.. and save record.

    Call this function on form load and change your attribute name

    function UpdateTodayDate()
    {
           var currentDate = new Date();
          Xrm.Page.getAttribute("new_todaysdate").setValue(currentDate );
    }


    Hope this will help.. 

  • Theohox13 Profile Picture
    on at
    RE: Set a field to Today() - a Changing date based on the current date

    this still doesnt work because you are performing an action with a trigger and creating a time stamp...I need this to be automatic like a clock. Think of the =TODAY() function in excel..whenever you load the sheet the date changes to the current date

  • PS Profile Picture
    23,577 on at
    RE: Set a field to Today() - a Changing date based on the current date

    crmbusiness.wordpress.com/.../crm-2011-javascript-to-set-the-current-date-and-time

  • Theohox13 Profile Picture
    on at
    RE: Set a field to Today() - a Changing date based on the current date

    this is a time stamp of an action, so it will not work. Im looking for a dynamic value of  time..basically i want the cell to be a clock..if you refresh the page the cell will contain a different time. Although i dont need it down to the second or minute..but i need it by the day.

    My probelm is that we have appointment metrics where you need to visist a customer every 6 months... so i want a calcualted cell to say "no" if the account hasnet been visited in the last 6 months based on the MAX visit date.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Aric Levin - MVP Profile Picture

Aric Levin - MVP 2 Moderator

#2
MA-04060624-0 Profile Picture

MA-04060624-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans