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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Answered

Javascript code on custom button not working

(0) ShareShare
ReportReport
Posted on by 235

Hello CS Experts,

I have place a custom button on the home tab of Contact entity.

The purpose of this button is to update the selected records wherein a date field will be updated to current date.

I used ribbon workbench to add the custom button. Everything went well when I published the solution that contains the button.

When I got to My Active Contacts view and select 2 or more records there, the button becomes visible.

However, the javascript code that will update the selected records does not work.

Please see below for the button:

Multiple_5F00_records.JPG

Below is my javascript code:

pastedimage1670327501934v1.png

I could not point out what is wrong with the code. Please help me correct it.

Thank you very much in advance!

Regards,

Jolas365

  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello Jolas,

    Replace SelectedRecords(i) with SelectedRecords[i].

  • Verified answer
    Wesley Nell Profile Picture
    65 on at

    HI Jolas,

    In addition to Andrew's comment. There is a type in the code. Please update "

    parameters.emtity = entity;
    
    //Change the above spelling error to
    parameters.entity = entity;

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 Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Daniyal Khaleel Profile Picture

Daniyal Khaleel 62 Most Valuable Professional

#2
11manish Profile Picture

11manish 23 Super User 2026 Season 2

#3
Travis South Profile Picture

Travis South 10

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans