Using multiple JavaScriptFunction for Actions in CRM 2011 Ribbon.


We had a requirement in which we wanted to add some functionality on the existing Distribute Campaign Activity button for Campaign Activity entity.

For e.g. before we start the distribution we wanted to check for a specific value for all the Marketing Lists associated to that Campaign Activity. Based on it we wanted to proceed further or stop the distribution.

So we created a new custom button using the same definitions used for the existing Distribute Campaign Activity button (i.e. same CommandDefinitions and RuleDefinitions). The only thing we added was the new JavaScriptFunction in the Actions menu. It was referring to the function name CheckMLUA inside the webresource name new_CheckML

Now inside this new JavaScriptFunction we wanted to call the CallDistribute function that is being used by the OOB Distribute Campaign Activity button

For this to work we defined the FunctionName as isNAN for campaignactivity.js.

“For each library, add a <JavaScriptFunction Library=”$webresource:webresourceName” FunctionName=”isNaN” /> node. It requires a function name, so we’ve just been putting isNaN in there so there’s no error.”

FunctionName=CheckMLUA />


Value=PrimaryEntityTypeCode />


And our function


 <CustomAction Id="WWB.Form.campaignactivity.MainTab.Actions.Distribute.CustomAction" Location="Mscrm.Form.campaignactivity.MainTab.Actions.Controls._children" Sequence="41">
 <Button Id="WWB.Form.campaignactivity.MainTab.Actions.Distribute" Command="WWB.Form.campaignactivity.MainTab.Actions.Distribute.Command" Sequence="0" ToolTipTitle="$LocLabels:WWB.Form.campaignactivity.MainTab.Actions.Distribute.LabelText" LabelText="$LocLabels:WWB.Form.campaignactivity.MainTab.Actions.Distribute.LabelText" ToolTipDescription="$LocLabels:WWB.Form.campaignactivity.MainTab.Actions.Distribute.Description" TemplateAlias="o1" Image16by16="/_imgs/MA/CampaignActivityDistribute_16.png" Image32by32="/_imgs/MA/CampaignActivityDistribute_32.png" />
 <RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates>
 <CommandDefinition Id="WWB.Form.campaignactivity.MainTab.Actions.Distribute.Command">
 <EnableRule Id="WWB.Form.campaignactivity.MainTab.Actions.Distribute.Command.EnableRule.FormStateRule" />
 <DisplayRule Id="WWB.Form.campaignactivity.MainTab.Actions.Distribute.Command.DisplayRule.EntityPrivilegeRule" />
 <JavaScriptFunction Library="$webresource:new_CheckML" FunctionName="CheckMLUA" />
 <JavaScriptFunction FunctionName="isNaN" Library="/_static/ma/campaignactivity/campaignactivity.js">
 <CrmParameter Value="PrimaryEntityTypeCode" />
 <TabDisplayRules />
 <DisplayRule Id="WWB.Form.campaignactivity.MainTab.Actions.Distribute.Command.DisplayRule.EntityPrivilegeRule">
 <EntityPrivilegeRule EntityName="activitypointer" PrivilegeDepth="Basic" PrivilegeType="Create" />
 <EnableRule Id="WWB.Form.campaignactivity.MainTab.Actions.Distribute.Command.EnableRule.FormStateRule">
 <FormStateRule State="Existing" />
 <LocLabel Id="WWB.Form.campaignactivity.MainTab.Actions.Distribute.Description">
 <Title languagecode="1033" description="Distribute Description" />
 <LocLabel Id="WWB.Form.campaignactivity.MainTab.Actions.Distribute.LabelText">
 <Title languagecode="1033" description="Distribute" />

The helpful links


Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

2 thoughts on “Using multiple JavaScriptFunction for Actions in CRM 2011 Ribbon.”

  1. so the only significance of using the isNaN function specifically is that you needed any legitimate function to call that wouldnt throw an error? perhaps that should be expanded on in your blog entry as its not particularly obvious.


Please share your thoughts

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

You are commenting using your 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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Welcome to the Blog & Website of Paul Andrew

Technical Leadership Centred Around the Microsoft Data Platform

Deriving Dynamics 365

Deriving Solutions and features on Power Platform/Dynamics 365

The CRM Ninja

Thoughts & musings from a Dynamics 365 Ninja!

CRM for You and Me

Customer Relationship Mgt App for the Professional

D CRM Explorer

Learn about Microsoft Dynamics CRM Power Platform customization and implementation and other cool stuffs

Stroke // Jonas Rapp

I know pre-stroke. I will improve who I was.

Power Melange

Power Melange By Shalinee

Clavin's Blog

Power Automate - Power Apps - SharePoint Online - Azure - Nintex - K2 - Artificial Intelligence

Sat Sangha Salon

An Inquiry in Being

The Indoencers

The Influencers & Influences of Indian Music

Monika Halan's blog

Hand's-free money management

D365 Demystified

A closer look at Microsoft Dynamics 365.

Microsoft Mate (msftmate) - Andrew Rogers

Experienced consultant primarily focused on Microsoft Dynamics 365 and the Power Platform


Specific topics by Django Lohn on the whole Microsoft365 Stack

Manmit Rahevar's Blog

One Stop Destination for Microsoft Technology Solutions


Naturally Curious

Brian Illand

Power Platform and Dynamics 365

Steve Mordue MVP

A Microsoft Business Applications MVP

Subwoofer 101

Bass defines your home theater

SQLTwins by Nakul Vachhrajani

SQL Server tips and experiences dedicated to my twin daughters.

Everything D365

Discovering Azure DevOps and D365 Business Applications

Tech Wizard

Lets do IT Spells

XRM Tricks (Power Platform & Dynamics CRM )

Power Platform & Dynamics CRM


Mail to for queries and suggestions

Giving back to the community what I have learned

xrm CRM Dynamics

Dynamics CRM Technical & Functional Info

Dynamics 365 Blogs - Explained in unique way

Sometimes you need to look at things from different perspective.

CRM Keeper

Dynamics 365 Customer Engagement, CRM, Microsoft CRM, Dynamics CRM


Step into the world of a Dynamics 365 Consultant

Dianamics PCF Lady

Diana & Dynamics 365 & Power Platform

Sara Lagerquist

No Code Customization Concepts


developer, designer, writer, fun loving, patriotic, humble and a sweet person inside out :) love and respect people who have a great sense of humor.

Temmy Wahyu Raharjo

dreaming to be a clean coder and TDD minded programmer.

%d bloggers like this: