Skip to main content

Notifications

Customer Service forum
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,321 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

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,782 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,067 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,150

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans