Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested answer

Javascript to update date field of selected records from contact view into current date.

(0) ShareShare
ReportReport
Posted on by 235

Hello CS Experts,

How are you? Here I am again asking for your help.

First, thank you for all your help in my previous post.

Now, I have a new requirement to update a date field into current date of records which are selected from contact main view. The update will trigger when the custom button below is clicked. The button gets visible only when at least 1 record is selected from the view.

How do I write the javascript code for this?

pastedimage1665364202444v1.png

Kind regards,

Jolas365

  • Suggested answer
    CRMJetty Profile Picture
    CRMJetty 3,508 on at
    RE: Javascript to update date field of selected records from contact view into current date.

    Hi Jolas365 ,

    You can create JS WebResource to update selected records and call JS function in ribbon button command. You can set enable rule for ribbon button to hide show button based on record selection.


    Refer below links to get selected record GUIDs in JS function, and update records using GUIDs in JS:
    https://d365demystified.com/2020/06/21/pass-selected-rows-guids-to-ribbon-button-in-d365-ribbon-workbench/
    https://dynatecon.com/2022/07/20/update-multiple-records-using-custom-button/


    Refer below links to show ribbon button on selection of at least one record from grid:
    https://d365demystified.com/2020/03/06/show-ribbon-button-only-on-record-selection-in-dynamics-crm/
    https://community.dynamics.com/365/b/d365demystified/posts/show-ribbon-button-only-on-record-selection-in-dynamics-crm

    I hope it helps,

    Thanks.

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Portal.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,430 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans