SlideShare una empresa de Scribd logo
1 de 19
How to customize the new CRM 2011 UR12 process
 driven (Polaris) forms using JQuery and JavaScript




                               www.dynamic-crm.com
   Before its release, there was certainly plenty of
    buzz surrounding Update Rollup 12 for Microsoft
    Dynamics CRM 2011, especially the new
    process driven UI.

   Unfortunately, if you plan on leveraging the new
    forms, one of the biggest drawbacks is the lack
    of support for form events such as OnLoad,
    OnChange, and OnSave.



                                          www.dynamic-crm.com
   So not being one to get easily discouraged, I set out on a
    mission to ensure that I could add my beloved client side
    scripting techniques to this rehabilitated user experience that
    Microsoft has bestowed upon me.

   So before I begin I must point out, that since there is no native
    support for scripting events related to the new forms, the
    approach outlined below is considered an unsupported
    customization.

   What this really means, is that any future updates from
    Microsoft could cause the execution of the scripts to halt.

   Additionally, this article assumes that you have a working
    knowledge of HTML and JQuery.


                                                      www.dynamic-crm.com
   Now, if you are still reading this then you are obviously a bold
    and daring individual or possibly just faced with a business
    scenario that needs to be solved.

   The code in future slides will demonstrate how to set the
    value of a field on the form. Using similar techniques, this
    same approach could be used to handle any number of
    alterations to the form.

   The first thing you will need to do is create a HTML page to
    handle our script. The new forms, Dynamics CRM 2011
    update, do not allow Javascript web resources to be directly
    inserted into the form.

   To get around this, we can use a HTML web resource. To
    create a new html page (which will eventually become our
    web resource), you can use any text editor. Simply create a
    new document and save it with the .htm extension.


                                                        www.dynamic-crm.com
   Obviously we want to ensure that we have the proper
    markup in our document, html, head, title etc. Now let’s
    get to our scripting.

   If you dig into the code rendered by the new crm 2011
    forms you will see that they rely on JQuery. This is great
    because using JQuery can save ourselves a ton of
    coding. Inside the head tag of our HTML document, we
    can add the same reference to JQuery that our CRM site
    uses which should be as follows:



                                                    www.dynamic-crm.com
www.dynamic-crm.com
    Between the opening and closing script tags, we will create our function.
     Since CRM will add our web resource within an iframe, we know that we
     want to get a reference to the parent or more specifically the main content
     window that contains the web resource.

    The rest of the code is described as follows:

1.     Get any “DIV” elements within the main document that have a “data-
       attributename” attribute that contains a value equal to our target field.

2.     Loop through the results, because the field may exist on both the form as
       well as the process header.

3.     Initiate a user click, using CRM’s built in function from the Mscrm.Utilities
       library, on the child element. This will expose the target field and ensure
       that it is ready to accept data.

4.     Set the underlying text field (or textarea) with the desired value.


                                                                        www.dynamic-crm.com
www.dynamic-crm.com
   The final step is to call our function. Typically to
     set the value of the budget amount field to
     $100,000.00 this would just be:




Now that would just be too good to be true, and it is. Before you can call the
function, you will need to ensure that the page is loaded and any related
scripts have executed.




                                                              www.dynamic-crm.com
   Using JQuery, we can encapsulate the call to
    our function with the window load event as
    follows:




     But wait! This still might not ensure that everything is done, so to
     be absolutely sure you can wait a few more milliseconds using
     the setTimeout MS CRM JavaScript method.




                                                                www.dynamic-crm.com
   In the next slide is an example of my final HTML
    page.

   I am calling the function twice, once to set the
    budget amount, and again to set the Current
    Situation field (both exist on my Opportunity form).




                                                www.dynamic-crm.com
www.dynamic-crm.com
   Now we can add this page as a web resource in
    CRM. Navigate to your Settings -> Customizations
    then click on Customize the System. This will
    launch the Components window.

   From here, select Web Resources in the left
    navigation. Click on New to launch the new web
    resource dialog. Enter the required information
    and select Web Page (HTML) as the Type.
    Browse to the file we created from the (Upload
    File) Choose File button. Then save and publish
    the web resource.


                                            www.dynamic-crm.com
   The Final step is to add the newly created web
    resource to the new form. From the form editor of the
    target form, click on the Insert tab then Web Resource
    from the ribbon control. Browse to the HTML web
    resource added above.

   Enter the required fields and ensure that Visible by
    default is not checked (this is so the actual HTML
    page does not display on the form, alternatively you
    can adjust the formatting to meet your needs) and
    Show this Web Resource in Read Optimized Form is
    checked.

                                                  www.dynamic-crm.com
www.dynamic-crm.com
   That’s all there is to it! Simply save, publish and close
    (you may also want to clear out your browsers cache).

   Leveraging JQuery and a similar approach, you can bind
    events to the fields to simulate the OnChange events as
    well. Obviously there are different approaches that one
    could take to accomplish similar results.

   I am sure if one were to spend enough time digging
    through the JScript libraries included in CRM’s root
    directory, they could find some additional functions to
    further ease the customization process (Oh, and if that
    person is you, feel free to let us know what you find).


                                                     www.dynamic-crm.com
   Would you like to customize MS Dynamics CRM
    2011 forms without having to read, write, or debug
    code?

   Oh, and in about half the time it normally takes?

   Then…… Download “Script Author” for FREE!



                                             www.dynamic-crm.com
   Script Author is Dynamic-CRM’s javascript
    generator that generates scripts in formatted,
    readable code for MS Dynamics CRM 2011.

   Script Author works with existing customizations,
    there is no intricate syntax to memorize and it
    requires NO programming knowledge!




                                           www.dynamic-crm.com
   Download your FREE version of Script Author.

   When you are ready to push your customizations
    to your CRM environment, then purchase your
    license key(s)!

   Happy coding!




                                          www.dynamic-crm.com

Más contenido relacionado

Similar a CRM 2011 JavaScript: Learn how to customize the new CRM 2011 UR12 process driven (Polaris) forms using JQuery and JavaScript

Create Custom Entity in CRM to Track Expenses! Okay, well maybe two custom en...
Create Custom Entity in CRM to Track Expenses! Okay, well maybe two custom en...Create Custom Entity in CRM to Track Expenses! Okay, well maybe two custom en...
Create Custom Entity in CRM to Track Expenses! Okay, well maybe two custom en...Dynamic-CRM
 
Microsoft Dynamics CRM – Web Resources
Microsoft Dynamics CRM – Web ResourcesMicrosoft Dynamics CRM – Web Resources
Microsoft Dynamics CRM – Web ResourcesDucat India
 
Microsoft Dynamics CRM Multi - Tier Architecture
Microsoft Dynamics CRM Multi - Tier ArchitectureMicrosoft Dynamics CRM Multi - Tier Architecture
Microsoft Dynamics CRM Multi - Tier ArchitectureNaveen Kumar
 
JavaScript 101 for Microsoft CRM 2011
JavaScript 101 for Microsoft CRM 2011JavaScript 101 for Microsoft CRM 2011
JavaScript 101 for Microsoft CRM 2011Will Slade
 
Crm dynamics workflow
Crm dynamics workflowCrm dynamics workflow
Crm dynamics workflowDynamic-CRM
 
WebServices Using Salesforce
WebServices Using SalesforceWebServices Using Salesforce
WebServices Using SalesforceAbdulImrankhan7
 
Chrome Developer Tools - Pro Tips & Tricks
Chrome Developer Tools - Pro Tips & TricksChrome Developer Tools - Pro Tips & Tricks
Chrome Developer Tools - Pro Tips & TricksMars Devs
 
Types, Features, and Examples of CMS for Web Development
Types, Features, and Examples of CMS for  Web DevelopmentTypes, Features, and Examples of CMS for  Web Development
Types, Features, and Examples of CMS for Web Developmentcompany
 
Integration with Microsoft CRM using Mule ESB
Integration with Microsoft CRM using Mule ESBIntegration with Microsoft CRM using Mule ESB
Integration with Microsoft CRM using Mule ESBSanjeet Pandey
 
13 technologies all dynamics crm developers must know
13 technologies all dynamics crm developers must know13 technologies all dynamics crm developers must know
13 technologies all dynamics crm developers must knowSanjaya Prakash Pradhan
 
Dynamics CRM Microsoft: Filter Look-Up Script
Dynamics CRM Microsoft: Filter Look-Up ScriptDynamics CRM Microsoft: Filter Look-Up Script
Dynamics CRM Microsoft: Filter Look-Up ScriptDynamic-CRM
 
Retrieve microsoft data
Retrieve microsoft dataRetrieve microsoft data
Retrieve microsoft dataSon Nguyen
 
Get Data from Microsoft CRM using Mule ESB
Get Data from Microsoft CRM using Mule ESBGet Data from Microsoft CRM using Mule ESB
Get Data from Microsoft CRM using Mule ESBSanjeet Pandey
 
Microsoft Dynamics CRM - Customization and Configuration Training Online Cour...
Microsoft Dynamics CRM - Customization and Configuration Training Online Cour...Microsoft Dynamics CRM - Customization and Configuration Training Online Cour...
Microsoft Dynamics CRM - Customization and Configuration Training Online Cour...Little Logic
 
Webservices using Salesforce
Webservices using SalesforceWebservices using Salesforce
Webservices using SalesforceKhasim Saheb
 
HTML5 Up and Running
HTML5 Up and RunningHTML5 Up and Running
HTML5 Up and RunningCodemotion
 
Rits Brown Bag - Extending and Integrating in Microsoft Dynamics CRM
Rits Brown Bag - Extending and Integrating in Microsoft Dynamics CRMRits Brown Bag - Extending and Integrating in Microsoft Dynamics CRM
Rits Brown Bag - Extending and Integrating in Microsoft Dynamics CRMRight IT Services
 
How does a cms website help your business to grow
How does a cms website help your business to growHow does a cms website help your business to grow
How does a cms website help your business to growFullestop
 
Ajax And Your Cms
Ajax And Your CmsAjax And Your Cms
Ajax And Your Cmsyiditushe
 

Similar a CRM 2011 JavaScript: Learn how to customize the new CRM 2011 UR12 process driven (Polaris) forms using JQuery and JavaScript (20)

Create Custom Entity in CRM to Track Expenses! Okay, well maybe two custom en...
Create Custom Entity in CRM to Track Expenses! Okay, well maybe two custom en...Create Custom Entity in CRM to Track Expenses! Okay, well maybe two custom en...
Create Custom Entity in CRM to Track Expenses! Okay, well maybe two custom en...
 
Microsoft Dynamics CRM – Web Resources
Microsoft Dynamics CRM – Web ResourcesMicrosoft Dynamics CRM – Web Resources
Microsoft Dynamics CRM – Web Resources
 
Microsoft Dynamics CRM Multi - Tier Architecture
Microsoft Dynamics CRM Multi - Tier ArchitectureMicrosoft Dynamics CRM Multi - Tier Architecture
Microsoft Dynamics CRM Multi - Tier Architecture
 
JavaScript 101 for Microsoft CRM 2011
JavaScript 101 for Microsoft CRM 2011JavaScript 101 for Microsoft CRM 2011
JavaScript 101 for Microsoft CRM 2011
 
Crm dynamics workflow
Crm dynamics workflowCrm dynamics workflow
Crm dynamics workflow
 
WebServices Using Salesforce
WebServices Using SalesforceWebServices Using Salesforce
WebServices Using Salesforce
 
Chrome Developer Tools - Pro Tips & Tricks
Chrome Developer Tools - Pro Tips & TricksChrome Developer Tools - Pro Tips & Tricks
Chrome Developer Tools - Pro Tips & Tricks
 
Types, Features, and Examples of CMS for Web Development
Types, Features, and Examples of CMS for  Web DevelopmentTypes, Features, and Examples of CMS for  Web Development
Types, Features, and Examples of CMS for Web Development
 
Integration with Microsoft CRM using Mule ESB
Integration with Microsoft CRM using Mule ESBIntegration with Microsoft CRM using Mule ESB
Integration with Microsoft CRM using Mule ESB
 
13 technologies all dynamics crm developers must know
13 technologies all dynamics crm developers must know13 technologies all dynamics crm developers must know
13 technologies all dynamics crm developers must know
 
Dynamics CRM Microsoft: Filter Look-Up Script
Dynamics CRM Microsoft: Filter Look-Up ScriptDynamics CRM Microsoft: Filter Look-Up Script
Dynamics CRM Microsoft: Filter Look-Up Script
 
Retrieve microsoft data
Retrieve microsoft dataRetrieve microsoft data
Retrieve microsoft data
 
Get Data from Microsoft CRM using Mule ESB
Get Data from Microsoft CRM using Mule ESBGet Data from Microsoft CRM using Mule ESB
Get Data from Microsoft CRM using Mule ESB
 
Microsoft Dynamics CRM - Customization and Configuration Training Online Cour...
Microsoft Dynamics CRM - Customization and Configuration Training Online Cour...Microsoft Dynamics CRM - Customization and Configuration Training Online Cour...
Microsoft Dynamics CRM - Customization and Configuration Training Online Cour...
 
Webservices using Salesforce
Webservices using SalesforceWebservices using Salesforce
Webservices using Salesforce
 
HTML5 Up and Running
HTML5 Up and RunningHTML5 Up and Running
HTML5 Up and Running
 
Rits Brown Bag - Extending and Integrating in Microsoft Dynamics CRM
Rits Brown Bag - Extending and Integrating in Microsoft Dynamics CRMRits Brown Bag - Extending and Integrating in Microsoft Dynamics CRM
Rits Brown Bag - Extending and Integrating in Microsoft Dynamics CRM
 
How does a cms website help your business to grow
How does a cms website help your business to growHow does a cms website help your business to grow
How does a cms website help your business to grow
 
Ajax And Your Cms
Ajax And Your CmsAjax And Your Cms
Ajax And Your Cms
 
Presemtation Tier Optimizations
Presemtation Tier OptimizationsPresemtation Tier Optimizations
Presemtation Tier Optimizations
 

Último

Call Girls Anjuna beach Mariott Resort ₰8588052666
Call Girls Anjuna beach Mariott Resort ₰8588052666Call Girls Anjuna beach Mariott Resort ₰8588052666
Call Girls Anjuna beach Mariott Resort ₰8588052666nishakur201
 
8377087607 Full Enjoy @24/7-CLEAN-Call Girls In Chhatarpur,
8377087607 Full Enjoy @24/7-CLEAN-Call Girls In Chhatarpur,8377087607 Full Enjoy @24/7-CLEAN-Call Girls In Chhatarpur,
8377087607 Full Enjoy @24/7-CLEAN-Call Girls In Chhatarpur,dollysharma2066
 
Lilac Illustrated Social Psychology Presentation.pptx
Lilac Illustrated Social Psychology Presentation.pptxLilac Illustrated Social Psychology Presentation.pptx
Lilac Illustrated Social Psychology Presentation.pptxABMWeaklings
 
2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)Delhi Call girls
 
Top Rated Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)Delhi Call girls
 
Introducing to billionaire brain wave.pdf
Introducing to billionaire brain wave.pdfIntroducing to billionaire brain wave.pdf
Introducing to billionaire brain wave.pdfnoumannajam04
 
call girls in candolim beach 9870370636] NORTH GOA ..
call girls in candolim beach 9870370636] NORTH GOA ..call girls in candolim beach 9870370636] NORTH GOA ..
call girls in candolim beach 9870370636] NORTH GOA ..nishakur201
 
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...PsychicRuben LoveSpells
 
CALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual serviceanilsa9823
 
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girlsPooja Nehwal
 
CALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual serviceanilsa9823
 
The Selfspace Journal Preview by Mindbrush
The Selfspace Journal Preview by MindbrushThe Selfspace Journal Preview by Mindbrush
The Selfspace Journal Preview by MindbrushShivain97
 
CALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female serviceanilsa9823
 
CALL ON ➥8923113531 🔝Call Girls Mahanagar Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Mahanagar Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Mahanagar Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Mahanagar Lucknow best sexual serviceanilsa9823
 
Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...
Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...
Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...anilsa9823
 
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Morcall Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Morvikas rana
 
LC_YouSaidYes_NewBelieverBookletDone.pdf
LC_YouSaidYes_NewBelieverBookletDone.pdfLC_YouSaidYes_NewBelieverBookletDone.pdf
LC_YouSaidYes_NewBelieverBookletDone.pdfpastor83
 
Pokemon Go... Unraveling the Conspiracy Theory
Pokemon Go... Unraveling the Conspiracy TheoryPokemon Go... Unraveling the Conspiracy Theory
Pokemon Go... Unraveling the Conspiracy Theorydrae5
 

Último (20)

Call Girls Anjuna beach Mariott Resort ₰8588052666
Call Girls Anjuna beach Mariott Resort ₰8588052666Call Girls Anjuna beach Mariott Resort ₰8588052666
Call Girls Anjuna beach Mariott Resort ₰8588052666
 
8377087607 Full Enjoy @24/7-CLEAN-Call Girls In Chhatarpur,
8377087607 Full Enjoy @24/7-CLEAN-Call Girls In Chhatarpur,8377087607 Full Enjoy @24/7-CLEAN-Call Girls In Chhatarpur,
8377087607 Full Enjoy @24/7-CLEAN-Call Girls In Chhatarpur,
 
Lilac Illustrated Social Psychology Presentation.pptx
Lilac Illustrated Social Psychology Presentation.pptxLilac Illustrated Social Psychology Presentation.pptx
Lilac Illustrated Social Psychology Presentation.pptx
 
2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)
 
Top Rated Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)
 
Introducing to billionaire brain wave.pdf
Introducing to billionaire brain wave.pdfIntroducing to billionaire brain wave.pdf
Introducing to billionaire brain wave.pdf
 
call girls in candolim beach 9870370636] NORTH GOA ..
call girls in candolim beach 9870370636] NORTH GOA ..call girls in candolim beach 9870370636] NORTH GOA ..
call girls in candolim beach 9870370636] NORTH GOA ..
 
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
 
CALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual service
 
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls
 
CALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual service
 
(Aarini) Russian Call Girls Surat Call Now 8250077686 Surat Escorts 24x7
(Aarini) Russian Call Girls Surat Call Now 8250077686 Surat Escorts 24x7(Aarini) Russian Call Girls Surat Call Now 8250077686 Surat Escorts 24x7
(Aarini) Russian Call Girls Surat Call Now 8250077686 Surat Escorts 24x7
 
The Selfspace Journal Preview by Mindbrush
The Selfspace Journal Preview by MindbrushThe Selfspace Journal Preview by Mindbrush
The Selfspace Journal Preview by Mindbrush
 
CALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female service
 
CALL ON ➥8923113531 🔝Call Girls Mahanagar Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Mahanagar Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Mahanagar Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Mahanagar Lucknow best sexual service
 
Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...
Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...
Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...
 
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Morcall Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
 
LC_YouSaidYes_NewBelieverBookletDone.pdf
LC_YouSaidYes_NewBelieverBookletDone.pdfLC_YouSaidYes_NewBelieverBookletDone.pdf
LC_YouSaidYes_NewBelieverBookletDone.pdf
 
Pokemon Go... Unraveling the Conspiracy Theory
Pokemon Go... Unraveling the Conspiracy TheoryPokemon Go... Unraveling the Conspiracy Theory
Pokemon Go... Unraveling the Conspiracy Theory
 

CRM 2011 JavaScript: Learn how to customize the new CRM 2011 UR12 process driven (Polaris) forms using JQuery and JavaScript

  • 1. How to customize the new CRM 2011 UR12 process driven (Polaris) forms using JQuery and JavaScript www.dynamic-crm.com
  • 2. Before its release, there was certainly plenty of buzz surrounding Update Rollup 12 for Microsoft Dynamics CRM 2011, especially the new process driven UI.  Unfortunately, if you plan on leveraging the new forms, one of the biggest drawbacks is the lack of support for form events such as OnLoad, OnChange, and OnSave. www.dynamic-crm.com
  • 3. So not being one to get easily discouraged, I set out on a mission to ensure that I could add my beloved client side scripting techniques to this rehabilitated user experience that Microsoft has bestowed upon me.  So before I begin I must point out, that since there is no native support for scripting events related to the new forms, the approach outlined below is considered an unsupported customization.  What this really means, is that any future updates from Microsoft could cause the execution of the scripts to halt.  Additionally, this article assumes that you have a working knowledge of HTML and JQuery. www.dynamic-crm.com
  • 4. Now, if you are still reading this then you are obviously a bold and daring individual or possibly just faced with a business scenario that needs to be solved.  The code in future slides will demonstrate how to set the value of a field on the form. Using similar techniques, this same approach could be used to handle any number of alterations to the form.  The first thing you will need to do is create a HTML page to handle our script. The new forms, Dynamics CRM 2011 update, do not allow Javascript web resources to be directly inserted into the form.  To get around this, we can use a HTML web resource. To create a new html page (which will eventually become our web resource), you can use any text editor. Simply create a new document and save it with the .htm extension. www.dynamic-crm.com
  • 5. Obviously we want to ensure that we have the proper markup in our document, html, head, title etc. Now let’s get to our scripting.  If you dig into the code rendered by the new crm 2011 forms you will see that they rely on JQuery. This is great because using JQuery can save ourselves a ton of coding. Inside the head tag of our HTML document, we can add the same reference to JQuery that our CRM site uses which should be as follows: www.dynamic-crm.com
  • 7. Between the opening and closing script tags, we will create our function. Since CRM will add our web resource within an iframe, we know that we want to get a reference to the parent or more specifically the main content window that contains the web resource.  The rest of the code is described as follows: 1. Get any “DIV” elements within the main document that have a “data- attributename” attribute that contains a value equal to our target field. 2. Loop through the results, because the field may exist on both the form as well as the process header. 3. Initiate a user click, using CRM’s built in function from the Mscrm.Utilities library, on the child element. This will expose the target field and ensure that it is ready to accept data. 4. Set the underlying text field (or textarea) with the desired value. www.dynamic-crm.com
  • 9. The final step is to call our function. Typically to set the value of the budget amount field to $100,000.00 this would just be: Now that would just be too good to be true, and it is. Before you can call the function, you will need to ensure that the page is loaded and any related scripts have executed. www.dynamic-crm.com
  • 10. Using JQuery, we can encapsulate the call to our function with the window load event as follows: But wait! This still might not ensure that everything is done, so to be absolutely sure you can wait a few more milliseconds using the setTimeout MS CRM JavaScript method. www.dynamic-crm.com
  • 11. In the next slide is an example of my final HTML page.  I am calling the function twice, once to set the budget amount, and again to set the Current Situation field (both exist on my Opportunity form). www.dynamic-crm.com
  • 13. Now we can add this page as a web resource in CRM. Navigate to your Settings -> Customizations then click on Customize the System. This will launch the Components window.  From here, select Web Resources in the left navigation. Click on New to launch the new web resource dialog. Enter the required information and select Web Page (HTML) as the Type. Browse to the file we created from the (Upload File) Choose File button. Then save and publish the web resource. www.dynamic-crm.com
  • 14. The Final step is to add the newly created web resource to the new form. From the form editor of the target form, click on the Insert tab then Web Resource from the ribbon control. Browse to the HTML web resource added above.  Enter the required fields and ensure that Visible by default is not checked (this is so the actual HTML page does not display on the form, alternatively you can adjust the formatting to meet your needs) and Show this Web Resource in Read Optimized Form is checked. www.dynamic-crm.com
  • 16. That’s all there is to it! Simply save, publish and close (you may also want to clear out your browsers cache).  Leveraging JQuery and a similar approach, you can bind events to the fields to simulate the OnChange events as well. Obviously there are different approaches that one could take to accomplish similar results.  I am sure if one were to spend enough time digging through the JScript libraries included in CRM’s root directory, they could find some additional functions to further ease the customization process (Oh, and if that person is you, feel free to let us know what you find). www.dynamic-crm.com
  • 17. Would you like to customize MS Dynamics CRM 2011 forms without having to read, write, or debug code?  Oh, and in about half the time it normally takes?  Then…… Download “Script Author” for FREE! www.dynamic-crm.com
  • 18. Script Author is Dynamic-CRM’s javascript generator that generates scripts in formatted, readable code for MS Dynamics CRM 2011.  Script Author works with existing customizations, there is no intricate syntax to memorize and it requires NO programming knowledge! www.dynamic-crm.com
  • 19. Download your FREE version of Script Author.  When you are ready to push your customizations to your CRM environment, then purchase your license key(s)!  Happy coding! www.dynamic-crm.com