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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

How to create custom field showing date?

(0) ShareShare
ReportReport
Posted on by 95

Hello,

I would like to create a field, which shows date and time of clicking "Sales ready" field. So, when user clicks the field "Sales ready", the new field shows the date. 

Should I use workflow? Calculated or rollup field? 

Thanks in advance

I have the same question (0)
  • Suggested answer
    Johnny Yun Profile Picture
    455 on at

    Hi Iza,

    Do you mean to show click date when onclick of one button?

    You could set custom field as Date and Time Data field and bind following functions on mentioned "Sales ready" in ribbon workbench

    function SetDays() {

       var currentDate = new Date();

       //currentDate.setHours(currentDate.getHours()+5);

       Xrm.Page.getAttribute("customfield").setValue(currentDate);

    }

    Please refer to Milan Pincar's suggestion for more details in the following post.

    community.dynamics.com/.../setting-date-and-time-field-using-javascript

    stackoverflow.com/.../dynamics-crm-javascript-onclick-function-for-date-change

    Regards

    Johnny

  • Iza Profile Picture
    95 on at

    Hi Johnny,

    Thanks for your respond. Unfortunately, I've never used Ribbon Workbench. Is it possbile to do it in another way?

    Regards

    Iza

  • Johnny Yun Profile Picture
    455 on at

    Hi Iza,

    You mentioned the field display current date time when customer click "Sales ready" field.

    From my point of view , this Sales Ready should be more like a button which help trigger onclick event.

    Workflow is usually triggered by entitiy data creation or modification which is regardless of onclick event. And Business Rules is mainly triggered by field attribute modification. Calculated field could display current data time while you still need to use JS function to call onclick event.

    So I recommend ribbon button to call the function and realize your request.

    Hope above would help.

    Regards

    Johnny

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Nagaraju_Matta Profile Picture

Nagaraju_Matta 123

#2
Hamza H Profile Picture

Hamza H 112 Super User 2026 Season 1

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 70 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans