Create a custom ribbon button on entity Homepage ribbon and get the selected record in Dynamics CRM 2011

Download CRM 2011 Visual Ribbon Editor tool from the following codeplex URL.

http://crmvisualribbonedit.codeplex.com/

1. Establish CRM connection

1

2. Select the entity to customize and click ‘OK’ to load entity ribbon customizations

2

3. Select ‘Homepage’ from Ribbon type dropdown list.

3

4. Select any ribbon button and click on ‘New Button’

5. Update the Ribbon button options in ‘Details’ tab.

4

6. Update the JavaScript options in ‘Action’ tab.

5

a. Add JavaScript function
Function Name: JavaScript function calling in ribbon button click
Library: JavaScript web resource name

b. Add CRM parameter and select the value as ‘SelectedControlSelectedItemReferences’

JavaScript code to get the selected record


function GetContacts(selectedEntityRefs)
{
alert("Id: " + selectedEntityRefs[0].Id +
"\n Name: " + selectedEntityRefs[0].Name +
"\n TypeCode: " + selectedEntityRefs[0].TypeCode +
"\n TypeName: " + selectedEntityRefs[0].TypeName);
}

6

Advertisement

One thought on “Create a custom ribbon button on entity Homepage ribbon and get the selected record in Dynamics CRM 2011

  1. Pingback: Personalizar Dynamics CRM 2015 Online con Javascript | Mi blog técnico

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 )

Facebook photo

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

Connecting to %s