Monday, July 18, 2011

Adding Buttons to the Form Ribbon in CRM 2011


How to Add Buttons to the Ribbon of any entities Form in CRM 2011.....
Steps:
1.)Export the solution with the required entity(means to which you want to add the custom group).
2.)Search the tab RibbonDiffXml.
3.)Add the Button tab to CustomAction tab inside CustomActions tab like below:
NOTE: Take care of the Location and the Sequence.
Here Location="Mscrm.Form.pat_audit.MainTab.Workflow.Controls._children"
4.) Now add the of both the button commands in CommandDefinitions tab as below:
So these buttons will be added in the form of pat_audit Entiy's Workflow(=Process) Group.If the Sequence will be same for two buttons then only one button will be shown in the Group due to overriding of the previous button so Sequence should be different.

NOTE: Create Two javascript Web Resources in CRM with the names

a) pat_AuditJSAccept with the function AuditAccept (you can change the names accordingly)
b) pat_AuditJSReject with the function AuditReject (you can change the names accordingly)
And Create 4 Image Web Resources in CRM with the names:
a) pat_Form1ButtonImage16 (you can change the names accordingly)
b) pat_Form1ButtonImage32 (you can change the names accordingly)
c) pat_Form1RejectImage16 (you can change the names accordingly)
d) pat_Form1RejectImage32 (you can change the names accordingly)

5.) TemplateAlias="o1" represents the Button style. here you can give it as "o2" also.
6.) Now save and zip all the customization and Import to the CRM.
7.) Publish all the customization and Refresh the browser.
Here in images I have used the entity name as “pat_audit”.

If any query , mail me at kumargovil@yahoo.co.in

Hope It will help.
Cheers!!
Thanks Dipendu for helping me.

No comments:

Post a Comment