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 :
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

I have the same question (0)
  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: Javascript code on custom button not working

    Hello Jolas,

    Replace SelectedRecords(i) with SelectedRecords[i].

  • Verified answer
    Wesley Nell Profile Picture
    65 on at
    RE: Javascript code on custom button not working

    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

Responsible AI policies

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

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

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

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 51 Super User 2025 Season 2

#2
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 46

#3
CU23101130-0 Profile Picture

CU23101130-0 17

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans