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 CRM (Archived)

How to add Javascript to Disqualify button on Lead Form

(0) ShareShare
ReportReport
Posted on by 5

On Lead forms when user clicks on Disqualify button i want to call our Custom javascript function to perform Something. How to achieve it? Through ribbon workbench i added a  javascript to just give some alert even that is not working. Do we need to add javascript for all the options shown for Disqualify? or we cant add Custom Javascript at all on Disqualify Button?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi Niti,

    Ideally when you customize action of Disqualify Lead button it will be impact your existing OOB functionality.  Better to write the logic inside plugin and throw exception from plugin.

    In other way you may try to write enable rule to show/Hide the button based on selection of the lead entity records. Here is the step -

    -> Go to ribbon workbench and select the buton.

    -> Click on Customize button and the Customize command.

    -> Go to command and then add custom javascript rule.

    -> Add your javascript funtion , select default false , invert false.

    -> Pass parameter type "‘SelectedControlSelectedItemReferences’" to get the lead ID.

    function run(selectedItems)
    {
        var selectedItem = selectedItems[0];
        // Here you can use the information below to open a new window or whatever!
        alert("Id=" + selectedItem.Id + "\nName=" + selectedItem.Name + "\nTypeCode=" + selectedItem.TypeCode.toString() + "\nTypeName=" + selectedItem.TypeName);
    }


    -> Retrieve the lead details using service request in the function and check your request and based on that return true or false.

    For more details you may get reference from here -

    ribbonworkbench.uservoice.com/.../129783-pass-the-currently-selected-grid-row-s-to-a-custo

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 CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans