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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Custom button on Home page grid ribbon work bench not triggering javascript

(5) ShareShare
ReportReport
Posted on by 84
Hi Everyone viewing this post, 
 
I created a custom button on home page grid (Merge Contact) as in below image
 
Set up a command to trigger JavaScript on click of this button as in below image. Button is appearing but JavaScript
is not triggering on click of this button, Please help have spent many days on this. 
 
 
Categories:
I have the same question (0)
  • Jimmy Passeti Profile Picture
    674 Most Valuable Professional on at
    Hello,
     
    Does the button has the command set properly?
    Can you send the JavaScript code? so we can check it.
     
    Regards,
    Jimmy Passeti | Microsoft MVP
    ✅ Please mark as Verified if this answered your question!
     
  • NV-12080530-0 Profile Picture
    84 on at
    Hi Jimmy, 
    Thanks for your response. 
    I just created a skeleton JavaScript function like below.
    If JS is triggered it should stop at "debugger".
    I commented all other lines. which I will fix once function is triggered.
     
    but it's not triggering
     
    function onMergeContactsClick(gridControl, selectedControlSelectedItemReferences, selectedEntityTypeName) 
    {
         debugger;
         //calling out of box code to launch the dialog
         ClientUtility.ClientUtil.launchUCIMergeDialog(gridControl, selectedControlSelectedItemReferences, selectedEntityTypeName);
         alert('coming here to Merge contacts');
        //Get Target entityid and subordinateEntityId from the Merge Dialog
        var subordinateEntityId="";
        var targetEntityId="";
        //var subordinateHasTeamPartyId=MergeContacts.CheckTeamPartyIdOfSecondaryRecord(subordinateEntityId);
        //var targetHasTeamPartyId=MergeContacts.CheckTeamPartyIdOfSecondaryRecord(targetEntityId);
        if (subordinateHasTeamPartyId && !targetHasTeamPartyId)
        {
            //MergeContacts.displayMergeContactTeamPartyMessage();
        }
     }
  • NV-12080530-0 Profile Picture
    84 on at
    Hi Jimmy, 
    Here is the command, scroll to the right to see the Action params
     
  • Verified answer
    NV-12080530-0 Profile Picture
    84 on at
    I resolved the issue myself, it was the JavaScript. 
     
    Its triggered on button click. 

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
iampranjal Profile Picture

iampranjal 51

#2
Martin Dráb Profile Picture

Martin Dráb 39 Most Valuable Professional

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 26 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans