TechNet
Products
IT Resources
Downloads
Training
Support
Products
Windows
Windows Server
System Center
Microsoft Edge
Office
Office 365
Exchange Server
SQL Server
SharePoint Products
Skype for Business
See all products »
Resources
Channel 9 Video
Evaluation Center
Learning Resources
Microsoft Tech Companion App
Microsoft Technical Communities
Microsoft Virtual Academy
Script Center
Server and Tools Blogs
TechNet Blogs
TechNet Flash Newsletter
TechNet Gallery
TechNet Library
TechNet Magazine
TechNet Wiki
Windows Sysinternals
Virtual Labs
Solutions
Networking
Cloud and Datacenter
Security
Virtualization
Updates
Service Packs
Security Bulletins
Windows Update
Trials
Windows Server 2016
System Center 2016
Windows 10 Enterprise
SQL Server 2016
See all trials »
Related Sites
Microsoft Download Center
Microsoft Evaluation Center
Drivers
Windows Sysinternals
TechNet Gallery
Training
Expert-led, virtual classes
Training Catalog
Class Locator
Microsoft Virtual Academy
Free Windows Server 2012 courses
Free Windows 8 courses
SQL Server training
Microsoft Official Courses On-Demand
Certifications
Certification overview
Special offers
MCSE Cloud Platform and Infrastructure
MCSE: Mobility
MCSE: Data Management and Analytics
MCSE Productivity
Other resources
Microsoft Events
Exam Replay
Born To Learn blog
Find technical communities in your area
Azure training
Official Practice Tests
Support options
For business
For developers
For IT professionals
For technical support
Support offerings
More support
Microsoft Premier Online
TechNet Forums
MSDN Forums
Security Bulletins & Advisories
Not an IT pro?
Microsoft Customer Support
Microsoft Community Forums
Sign in
Home
Library
Wiki
Learn
Gallery
Downloads
Support
Forums
Blogs
Resources For IT Professionals
United States (English)
Россия (Pусский)
中国(简体中文)
Brasil (Português)
Skip to locale bar
Post an article
Translate this page
Powered by
Microsoft® Translator
Wikis - Page Details
First published by
Jamie Miley
(dMV)
When:
8 Dec 2011 6:32 AM
Last revision by
Ed Price - MSFT
(aMicrosof)
When:
8 Dec 2011 9:43 AM
Revisions:
3
Comments:
1
Options
Subscribe to Article (RSS)
Share this
Can You Improve This Article?
Positively!
Click Sign In to add the tip, solution, correction or comment that will help other users.
Report inappropriate content using
these instructions
.
Wiki
>
TechNet Articles
>
How to Trigger a Plug-in from JScript in Microsoft Dynamics CRM
How to Trigger a Plug-in from JScript in Microsoft Dynamics CRM
Article
History
How to Trigger a Plug-in from JScript in Microsoft Dynamics CRM
From my time in the Microsoft Dynamics CRM forums, I can tell you that the question of how to trigger a plug-in from jscript comes up pretty frequently. Usually someone wants to just trigger the plug-in from a form event, but also sometimes people want to trigger the plug-in from a ribbon button. Unfortunately, a lot of the replies usually say that it's not supported or not possible. I am happy to say that it is possible and that I have regularly used this workaround to achieve this and it even uses supported methodology.
You can find an end-to-end code example here:
http://code.msdn.microsoft.com/Trigger-a-Plug-in-in-75699228
The code examples I link to today will be for CRM 2011 but the basic methodology is the same for 4.0 also.
Here is how this works:
1. First you need to create a new custom entity to act as a trigger entity, I'll often times even name this new custom entity "new_trigger{plugin name}"
Creating a Custom Entity
2. Now you must register your plug-in (or several plug-ins) on the create or update messages for this new entity. (
I usually prefer the create message for my registrations because a new record will be created which keeps a record or audit-trail of who manually executed your plug-in and when in the created by and created time-stamp attributes on the entity
)
Using the Plug-in Registration Tool for Microsoft Dynamics CRM 2011
(MSDN)
3. You must create a jscript web resource that contains a function that performs a soap update or create call on the entity depending on which message you registered your plug-in on.
Jscript Create Call Example
Jscript Update Call Example
Making Synchronous SOAP Calls Using Jscript
4. Lastly you must add your web resource to your form and call your update or create jscript function on one of the exposed form events (OnLoad, OnSave, etc...). You can also call your jscript function from ribbon button if you want.
Using Javascript Libraries on a Form in CRM 2011
Adding Ribbon Buttons in CRM 2011
I hope this helps!
crm
,
crm 2011
,
Development
,
JScript
,
Plug-ins
,
resources
[Edit tags]
Leave a Comment
Please add 7 and 5 and type the answer here:
Post
Wiki - Revision Comment List(Revision Comment)
Sort by:
Published Date
|
Most Recent
|
Most Useful
Comments
Ed Price - MSFT
8 Dec 2011 9:43 AM
Ed Price - MSFT edited Revision 1. Comment: Fonts. Great article!
Edit
Page 1 of 1 (1 items)
Wikis - Comment List
Sort by:
Published Date
|
Most Recent
|
Most Useful
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
Comments
Posted by
Ed Price - MSFT
on
8 Dec 2011 9:43 AM
Ed Price - MSFT edited Revision 1. Comment: Fonts. Great article!
Edit
Page 1 of 1 (1 items)