PL 400 : Create commands (Create a command button function)

Commands are the unique feature of software application which helps to implement logic and guides the user to take action. It refers to a graphical button that appears in a computer user interface, allowing the user to trigger an event with a keyboard button or mouse.


Microsoft introduced the Command and Command Bar to a lesser extent in CRM 2013. It appears at the top of the screen that is defined by the data for the tables and contains the definition of tabs and groups with scaling but only the visible portions of these containers for controls are displayed in the classic user interface.


Microsoft Dataverse displays commands with respect to tables and clients in a variety of ways. This graphical interface is organized in relation to other commands and linked to command bar locations. A command bar is made up of a set of commands associated with a specific location. Command bars are at the top of each model-powered app and appear in several different places. The command bar provides better performance. The ribbon is still displayed in the web application for certain forms and it is still used for list views in Dynamics 365 for Outlook.

We can identify four places for command bar:
  • Main Grid: The command bar for the main grid is the list view of records. This grid is accesses when using the sitemap to navigate to a table.
  • Main Form: This is the command bar that lives on a form. When we open the form, we’ll notice the command bar on the top of the form.
  • Sub grid View: These views are displayed on forms of other tables. 
  • Associated View: This command bar is shown on the form of a parental table and will show related data. 

There are two ways to design the command bar:

  • Classic Command
  • Command Designer

Classic Command:

Model-driven apps contain default <RibbonDiffXml> definitions for all ribbons in the application. Developers can export and view the current XML defining the ribbon , but they cannot update the XML directly. Developers should be exported the XML ribbon and define the changes under the  <CustomAction> or <HideCustomAction> elements. these changes will apply on the runtime when ribbon is displayed in the application.

Ribbon workbench is right tool to design the command bar with error free.



Command Designer:

Command Designer is new feature which is preview mode till blog writing. Although it is new infrastructure and stored as metadata, it runs side by side with classic commands. This designer alleviates many of the problems of the existing classical designer.


Conclusion:

Creating or modifying command buttons in Dynamics CRM is always a challenge, with the developer usually using the Ribbon workbench(much respect to the creator) for such activities. Modern Command Designer is a great initiative by Microsoft to reduce the complexity of this process and introduced the No/Low Code Designer where developers can define button behavior with Power FX and JavaScript. The most interesting feature is that it can be part of ALM.


Comments

Popular posts from this blog

Exploring the Differences: Managed vs. Unmanaged Solutions in Dynamics CRM/Dataverse

PCF vs. Web Resources: Choosing the Right Extensibility Tool for Dataverse

Effective Strategies for Debugging Plugins in Dynamics CRM