CRM 2011 Add JScript into Button Event JScript


Problem:
I created a custom ribbon button. The button added with onclick event function eg. GenerateNumbering.
The problem is i need to add another Javascript as Ref toward another javascript.
I used Visual Ribbon Editor to edit and create the custom button and only one Javascript can be insert into it.
That mean i cant call another javascript as reference.

Solution:
I Created a solution with the entity that i need to customize the ribbon button.
Export out the solution and edit the customization by adding in some javascript to call.
Eg.

Editing the xml in these section


<CommandDefinition Id="vwork.SubGrid.vw_outlet.MainTab.Layout.GenerateRoute.Command">
<EnableRules />
<DisplayRules />
<Actions>
<JavaScriptFunction FunctionName="isNaN" Library="$webresource:YourScriptName" />
<JavaScriptFunction FunctionName="isNaN" Library="$webresource:YourScriptName" />
<JavaScriptFunction FunctionName="isNaN" Library="$webresource:YourScriptName" />
<JavaScriptFunction Library="$webresource:YourScriptName" FunctionName="GenerateNumbering"/>
</Actions>
</CommandDefinition>

Save the customization xml, zipped it and import it back to the organization.
You can now call different function in other javascript u included above.

Thanks.
Hope my solution helps

0 comments: