Skip to main content

Notifications

Announcements

No record found.

Service | Customer Service, Contact Center, Fie...
Answered

Javascript code on custom button not working

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
    Wesley Nell Profile Picture
    Wesley Nell 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;

  • Verified answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Javascript code on custom button not working

    Hello Jolas,

    Replace SelectedRecords(i) with SelectedRecords[i].

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans