Thursday, June 13, 2019

How to create a Custom Button in Dynamic CRM and invoke a JavaScript method


Creating a button requires an image with following
  • correct size 16 X 16
  • which can denote a typical functionality
  • should be in-line with other icons in Dynamic CRM Theme.
  • It is easy and good option to do all configuration via Ribbon Workbench Tool.

Finding a Perfect Icons.
Usually we can google an icon based on the functionality we are interested in. 
However, I came to learn about these websites which provide free cool icons.

Making icon Right Size
For button on a form it should be of 16 X 16 pixels.
For Icon in Navigation it should be of 32 X 32 pixels.
Here is a online image resizer I often use - https://resizeimage.net/
Once you upload an image, just go to 4th Step and enter pixel size accordingly.


Next jump to Step 7 and hits the RESIZE button and download your image.

Creating a Button using Ribbon Workbench
1) Create a web-resource of your new image.

2) Create a Solution
It is suggested to have a solution with only relevant entities where we are interested in adding a button. We should not overload a solution with too many entities or other components, as it might affect the loading and publishing of a solution from a Ribbon Workbench.

Working the Ribbon workbench


Start with selecting an Entity.
  1. Drag a button from Toolbox to the form section or any section where you need it.
  2. Select the button to enable to button properties.
  3. Provide button properties like Label, Tool tips, etc.
  4. Select you image from the web-resource created.

  1. Jump to Command Section and add the command
  2. Rename the command with appropriate name that denote the required functionality
  3. If you want to pass any parameter – add parameter.

!!! Now Do not forget to bind your command to the button !!!


Hit the publish button on Ribbon workbench and wait for a while.
Finally, to see the outcome use Hard Refresh (CTRL + F5) to reload dynamic CRM.



Regards,
Vipin Jaiswal
vipinjaiswal12@gmail.com

No comments: