CRM Parameters in Ribbon WorkBench for Dynamics 365.


When we customize any OOB button or create a new button, ribbon workbench provide us a list of “CRM Parameters” to be used for either calling an action or Enable Rule. These parameters help us in passing values to our JS function parameters. Some of the most used have been described below.

  • PrimaryEntityTypeCode: It provide the Entity Object Code of the primary entity (The entity which is displaying on the UI) on which the JavaScript is running as the output. for E.g. if you are on account screen it should return 1. Check out this link for Object Type Code. https://msdynamicscrmblog.wordpress.com/2013/07/18/entity-type-codes-in-dynamics-crm-2011/
  • PrimaryEntityTypeName : It provide the Entity Logical of the primary entity (The entity which is displaying on the UI) on which the JS is running as the output.
  • PrimaryItemIds : Can be used on Homepage Grid to retrieve the GUID’s as an array of all the entity record displaying on the grid of the homepage.
  • FirstPrimaryItemId : This returns the GUID of the record which the user is viewing or on which the user is running the code. If user is woring on a contact screen it will return the GUID of that contact.
  • PrimaryControl : This is one of the most used CRM parameter on the Ribbon Workbench for the Button. After the deprecation of Xrm.Page, The new way to pass the execution context to the javaScript is by passing PrimaryControl as the parameter for executionContext.
  • SelectedEntityTypeName : Generally used for button on homepage or Subgrids. This is required when you need to get the entity name of the subgrid on which the button is. So if you select a list of rows from a subgrid, then by using this parameter you can get the name of the entity.
  • SelectedEntityTypeCode : Similar to SelectedEntityTypeName this is also used for button on homepage or Subgrids. This is required when you need to get the entity Object Code of the subgrid on which the button is. So if you select a list of rows from a subgrid, then by using this parameter you can get the entity Object Code of the entity.
  • SelectedControl : This can be used to pass the context of a subgrid to the code as an object.
  • SelectedControlSelectedItemCount : Returns the Count of the items/entity records you have selected on the grid, This parameter can be passed for the buttons on the form or on the HomePage
  • SelectedControlSelectedItemIds : Returns the GUID(In an array of string) of all the items/entity records you have selected on the grid, This parameter can be passed for the buttons on the form

For more info you can check on MSDN: https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/customize-dev/pass-dynamics-365-data-page-parameter-ribbon-actions

Hope it helps!
You can reply for any change or correction.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s