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
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
Mohamed Amine Mahmoudi
83
Super User 2025 Season 1
Community Member
52
Victor Onyebuchi
6