How to Run JS snippet using Smart Button in Ribbon Workbench?
In this blog, we’ll show you how you can call a piece of JavaScript code snippet using a smart button in the Ribbon Workbench. If you haven’t yet installed smart Buttons to your Ribbon Workbench in your organization – For that here's a blog from which you could add buttons – https://www.xrmlabs.com/About-Us/XRMs-Blog/Post/8466/How-to-Install-Smart-Buttons-for-Ribbon-Workbench-XrmToolBox