Customizing the ribbon in Microsoft Dynamics 365 provides an efficient way to tailor the user interface to specific business requirements. By adding customized ribbons, you can enhance user productivity, streamline workflows, and provide a more tailored experience for your users. Whether you’re a system administrator, developer, or end-user looking to personalize your workspace, this guide will empower you with the knowledge and steps to add ribbons to forms in Dynamics 365.
Ribbons serve as a crucial element in the Dynamics 365 interface, offering a structured and intuitive way to access commands and functionalities. They can be customized to include buttons, menus, and galleries, allowing you to group related actions together. By adding ribbons to forms, you can provide users with quick and easy access to the tools they need, reducing the time spent searching for specific commands and improving overall efficiency. Furthermore, ribbons can be tailored to different user roles, ensuring that each user has a tailored experience based on their specific responsibilities.
Adding ribbons to forms in Dynamics 365 is a straightforward process that can be accomplished using the Ribbon Workbench. This user-friendly tool allows you to create, edit, and manage ribbons without the need for extensive coding knowledge. In this article, we will guide you through the steps of adding ribbons to forms using the Ribbon Workbench, providing detailed instructions and helpful tips to ensure a successful customization experience.
Add a Button to the Group
To add a button to a group on a ribbon in Dynamics 365, follow these detailed steps:
-
Create a new group: In the Ribbon Workbench editor, select the ribbon you want to modify and click on the "Groups" tab. Click on the "New" button to create a new group.
-
Configure the group properties: Enter a name and label for the group, as well as any other desired properties, such as description, tooltip, and icon.
-
Select the appropriate command: In the "Commands" tab, click on the "New" button to create a new command. In the "Command Type" field, select "Button."
-
Configure the button properties: Enter a name and label for the button, as well as any other desired properties, such as description, tooltip, and image.
-
Specify the action to be performed: In the "Action" tab, you can specify the action to be performed when the button is clicked. There are several options available:
- Navigate to a URL: This option allows you to specify a URL to open in a new tab or window when the button is clicked. Enter the full URL, including the “http://” or “https://” prefix.
- Open a form: This option allows you to specify a form to open when the button is clicked. Select the desired form from the available options.
- Execute a JavaScript function: This option allows you to execute a custom JavaScript function when the button is clicked. Enter the JavaScript code in the text field provided.
- Call a Microsoft Dynamics 365 action: This option allows you to call a Microsoft Dynamics 365 action when the button is clicked. Select the desired action from the available options.
- Fire a custom event: This option allows you to fire a custom event when the button is clicked. Enter the name of the custom event in the text field provided.
-
Set the button order: To arrange the order of the buttons in the group, use the up and down arrows next to each button in the "Commands" tab.
-
Save and publish: Once you have configured the button and its properties, click on the "Save" button to save the changes. Then, click on the "Publish" button to publish the ribbon customizations.
-
Test the button: After publishing the customizations, you can test the button by navigating to the ribbon in the Dynamics 365 application. Click on the button to verify that it performs the intended action.
Add a Command to the Button
Now that you have created a button, you need to add a command to it. A command defines the action that the button will perform when it is clicked. To add a command to a button, follow these steps:
1. In the Ribbon Workbench, select the button that you want to add a command to.
2. In the Properties pane, click the Commands button.
3. In the Commands dialog box, click the Add button.
4. In the Add Command dialog box, select the command that you want to add to the button.
5. Click the OK button.
6. The command will now be added to the button.
You can also add multiple commands to a button. To do this, simply repeat the steps above for each command that you want to add.
When a button has multiple commands, the user will be able to choose which command they want to execute when they click the button. The commands will be displayed in a drop-down list next to the button.
Here is a table that summarizes the steps for adding a command to a button:
Step | Action |
---|---|
1 | Select the button that you want to add a command to. |
2 | Click the Commands button in the Properties pane. |
3 | Click the Add button in the Commands dialog box. |
4 | Select the command that you want to add to the button. |
5 | Click the OK button. |
6 | The command will now be added to the button. |
Once you have added a command to a button, you can test it by clicking the button in the Ribbon Workbench. The command will be executed and the results will be displayed in the Ribbon Workbench.
Configure the Command Properties
The “Configure the Command Properties” section of the ribbon customization process in Dynamics 365 allows you to specify the behavior and appearance of the command button that will be added to the ribbon. Here is a detailed breakdown of the properties you can configure:
Image
Select an image to represent the command button on the ribbon. This image will appear in the button’s icon.
Label
Enter the text label that will appear next to the command button’s icon on the ribbon.
ToolTip
Provide a tooltip description that appears when the user hovers over the command button. This tooltip provides additional information about the command’s function.
Command
Select the command that will be executed when the button is clicked. You can choose from a list of available commands provided by Dynamics 365, such as “Save,” “Delete,” or “Export to Excel.”
Display Rule
Specify a display rule to define when the command button should be visible and enabled on the ribbon. You can use conditions based on record properties, form state, or user security roles.
Security Role
Select the security role(s) that have permission to use the command button. This ensures that only authorized users can access and execute the command.
Enabled
Enable or disable the command button by default. This property allows you to temporarily disable the button if certain conditions are not met.
Default
Mark the command as the default button, which will be executed when the user presses the Enter key while the form is active.
Group
Specify the group to which the command button belongs. This helps organize the commands on the ribbon and create a logical hierarchy.
Position
Enter the position of the command button within the group. This determines the order in which the buttons appear.
Size
Select the size of the command button, such as “Normal” or “Large.” This affects the button’s dimensions and visibility.
Description
Provide a description of the command button’s functionality for documentation purposes. This description is not visible to users.
Arguments
Specify any arguments that are required by the command to execute. These arguments can be used to pass additional information to the command.
Template Arguments
Define template arguments that allow you to customize the command button’s behavior based on the context of the form. These arguments are evaluated at runtime.
Action
Select the action that the command button should perform when clicked. This can be a JavaScript function or a custom action provided by Dynamics 365.
Supported Actions
There are three supported actions for ribbon commands:
Action | Description |
---|---|
JavaScript Function | Executes a JavaScript function defined in the form’s script library. |
Custom Action | Calls a custom action registered in the system by a plugin or solution. |
Disabled | Prevents the command from executing any action. |
Add a Contextual Tab
A contextual tab is a tab that appears on the ribbon only when a specific record is selected. This can be useful for providing additional options that are only relevant to that particular record. To add a contextual tab, you will need to create a ribbon workbench solution and add a new tab to the ribbon.
Once you have created a new tab, you can add a group to the tab and then add buttons or other controls to the group.
Adding a Group to a Tab
To add a group to a tab, select the tab in the ribbon workbench and click the “Add Group” button. You will need to give the group a name and a display name.
Adding Buttons or Controls to a Group
To add a button or control to a group, select the group in the ribbon workbench and click the “Add Control” button. You will need to select the type of control that you want to add and then provide the necessary information.
Specifying the Display Rule for a Tab
Once you have added the controls to the group, you will need to specify the display rule for the tab. The display rule determines when the tab will appear on the ribbon. You can use the following operators to create a display rule:
- Equals
- Not Equals
- Greater Than
- Less Than
- Greater Than or Equal To
- Less Than or Equal To
- Contains
- Does Not Contain
- Begins With
- Ends With
You can also use the following functions to create a display rule:
- Is Null
- Is Not Null
- IsEmpty
- IsNotEmpty
Example: Adding a Contextual Tab for the Account Entity
Let’s say we want to add a contextual tab for the Account entity that displays a button to open the account’s website. We would first create a ribbon workbench solution and add a new tab to the ribbon. We would then add a group to the tab and add a button to the group. Finally, we would specify the display rule for the tab so that it only appears when an account record is selected.
The following table shows the steps involved in adding a contextual tab for the Account entity:
Step | Description |
---|---|
1 | Create a ribbon workbench solution. |
2 | Add a new tab to the ribbon. |
3 | Add a group to the tab. |
4 | Add a button to the group. |
5 | Specify the display rule for the tab. |
Set the Contextual Tab Button Security
Configure the security roles to control which users have access to the contextual tab buttons.
Step 33.1: Access the Security Role
Navigate to the “Settings” area and select “Security.” Under “Users,” click “Security Roles.”
Step 33.2: Select the Role to Modify
Select the security role you want to modify and click “Edit.”
Step 33.3: Open the Customization Tab
Click on the “Customization” tab in the security role form.
Step 33.4: Edit Privileges for Web Application Access
Expand the “Web Application Access” section and click on “Edit Privileges.”
Step 33.5: Locate the Site Map Privileges
Scroll down to the “Site Map” section in the privilege list.
Step 33.6: Search for the Contextual Tab Area
Use the search bar to find the contextual tab area where you want to add the button.
Step 33.7: Set the Privileges
In the “Privilege Level” column, set the appropriate privilege level for the contextual tab button. The options are:
- None: The user has no access to the button.
- User: The user can view and use the button.
- Admin: The user can view, use, and edit the button.
Step 33.8: Repeat for Other Contextual Tab Areas
If you need to set privileges for buttons in other contextual tab areas, follow steps 33.5 to 33.7 for each area.
Step 33.9: Save Changes
Click “Save” to apply the changes to the security role.
Step 33.10: Verify Button Security
To verify the button security, log in as a user with the modified security role. Navigate to the form and check if the contextual tab button is visible and accessible.
Notes:
- If you want to hide the contextual tab area completely, set the “Privilege Level” to “None” for the corresponding site map privilege.
- You can use the “User” privilege level to allow users to view and use the button, but prevent them from making changes to the button.
- The “Admin” privilege level grants full control over the button, including the ability to edit its properties and visibility.
Additional Information
The following table summarizes the privilege levels for contextual tab buttons:
Privilege Level | Description |
---|---|
None | The user cannot view or use the button. |
User | The user can view and use the button, but cannot edit its properties or visibility. |
Admin | The user can view, use, edit, and delete the button. |
Add a Command to the Contextual Tab Menu Item
The contextual tab menu item allows you to add commands to the ribbon that are specific to the selected record or context. To add a command to the contextual tab menu item, follow these steps:
-
Open the solution explorer and expand the Ribbon node.
-
Right-click on the Contextual Tab Menu node and select Add.
-
In the Add Contextual Tab Menu Item dialog box, enter the following information:
- Label: The label that will be displayed on the ribbon.
- Command: The name of the command that will be executed when the button is clicked.
- Group: The group that the command will be added to.
- Order: The order in which the command will appear in the group.
-
Click OK to save the changes.
The following table provides a list of the available options for the Contextual Tab Menu Item dialog box:
Option | Description |
---|---|
Label | The label that will be displayed on the ribbon. |
Command | The name of the command that will be executed when the button is clicked. |
Group | The group that the command will be added to. |
Order | The order in which the command will appear in the group. |
Enabled | Specifies whether the command is enabled. |
Visible | Specifies whether the command is visible. |
Image | The image that will be displayed on the button. |
Tooltip | The tooltip that will be displayed when the mouse hovers over the button. |
Creating a Custom Command
In order to add a custom command to the contextual tab menu item, you will need to create a custom action or a custom command.
Custom actions:
Custom actions are defined in the Ribbon workbench. To create a custom action, follow these steps:
-
Open the Ribbon workbench.
-
Click on the New button.
-
In the New Action dialog box, enter the following information:
- Name: The name of the action.
- Label: The label that will be displayed on the ribbon.
- Command: The name of the command that will be executed when the action is clicked.
- Group: The group that the action will be added to.
- Order: The order in which the action will appear in the group.
-
Click OK to save the changes.
Custom commands:
Custom commands are defined in code. To create a custom command, follow these steps:
-
Create a new class library project in Visual Studio.
-
Add the following references to the project:
- Microsoft.Dynamics.CRM
- Microsoft.Xrm.Sdk
-
Create a new class that inherits from the IPlugin interface.
-
Implement the Execute method of the IPlugin interface.
-
In the Execute method, write the code that will be executed when the command is clicked.
-
Build the project.
-
Register the plugin with Dynamics 365.
Adding the Command to the Contextual Tab Menu Item
Once you have created the custom command, you can add it to the contextual tab menu item. To do this, follow these steps:
-
Open the solution explorer and expand the Ribbon node.
-
Right-click on the Contextual Tab Menu Item node and select Add.
-
In the Add Contextual Tab Menu Item dialog box, enter the following information:
- Label: The label that will be displayed on the ribbon.
- Command: The name of the custom command that will be executed when the button is clicked.
- Group: The group that the command will be added to.
- Order: The order in which the command will appear in the group.
-
Click OK to save the changes.
Conclusion
By following these steps, you can add custom commands to the contextual tab menu item. This allows you to add functionality to the ribbon that is specific to the selected record or context.
How to Add Ribbon to Form Dynamics 365
Adding a ribbon to a form in Dynamics 365 allows you to provide users with a consistent and easy way to access commonly used actions and commands. Here’s how to add a Ribbon to a form in Dynamics 365:
- Open the form you want to add the Ribbon to.
- Click the “Edit” button in the top-right corner of the form.
- In the “Form Properties” dialog box, click the “Ribbon” tab.
- Click the “Add Ribbon” button.
- In the “Ribbon Editor” dialog box, select the Ribbon you want to add from the list of available Ribbons.
- Click the “OK” button to save the changes.
The added ribbon will now be visible on the form.
People Also Ask
How to add custom buttons to the Ribbon Dynamics 365?
To add custom buttons to the Ribbon in Dynamics 365, you can use the Ribbon Workbench. The Ribbon Workbench is a tool that allows you to create and edit Ribbons for Dynamics 365.
How to hide the Ribbon Dynamics 365?
To hide the Ribbon in Dynamics 365, you can use the “Hide Ribbon” action in the Ribbon Workbench. The “Hide Ribbon” action will remove the Ribbon from the form.
How to change the order of the tabs on the Ribbon Dynamics 365?
To change the order of the tabs on the Ribbon in Dynamics 365, you can use the “Move Tab” action in the Ribbon Workbench. The “Move Tab” action will allow you to move the tabs to the desired order.