Dynamics CRM Javascript · Dynamics CRM Ribbon Customization · Javascript

Get Parent and Child Entity Name Dynamically on ribbon button custom rule

To get parent and child entity name from ribbon button custom javascript rule we need to pass 2 CRM parameters from action rule.

PrimaryEntityTypeName

SelectedEntityTypeName

I have created new solution and added account entity. I opened this solution in ribbon workbench and added 2 button one on main form and other on subgrid.

I passed 3 parameters as shown below from ribbon workbench custom javascript rule.

Ribbon3

I added below JS code to check the result from Main and Subgri form.

function TestRibbonButton(x,y,z)
{
alert(“PrimaryEntityTypeName “+x);
alert(“SelectedEntityTypeName “+y);
alert(“PrimaryEntityTypeCode “+z);
}

Main Form 

PrimaryEntityTypeName  account
SelectedEntityTypeName  account
PrimaryEntityTypeCode  1

Subgrid
PrimaryEntityTypeName   contact
SelectedEntityTypeName   account
PrimaryEntityTypeCode 2

Hope this helps!

One thought on “Get Parent and Child Entity Name Dynamically on ribbon button custom rule

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