locked
crm 2011 test customization problem RRS feed

  • Question

  • Hello when i write some javascript code for customization phone call form in crm 2011 when i save the changes and click preview the form i cant see my changes.when i publish the form javascript code starts to work

     

    is it a bug or a new properties on crm 2011?

     

    thx


    Software Specialist Crm
    Friday, November 4, 2011 9:14 AM

Answers

  • Greetings,

    To the best of my knowledge the reason why you can not preview a javascript in crm 2011 is because the javascripts have moved from the form itself and are web resource objects (in crm 4.0 it was just one object (form and javascript together) but in 2011 it is 2 objects (javascript(webresource) and form (2 different objects))).

    So the form does read from the same secondary object (the webresource) either if you press preview or if you open it live, this is why you have to publish the javascript webresource on its own for it to show on the form.

    You have a few options here,

    1. ideal would be to have a dev environment set up
    2. You can surround your javascript with a user check (check if the user is you) and then remove that bit when you have finished testing the javascript and want to put it live.
    3. You can test it out on another entity if the javascript functionalitiy allows it(if it has similar fields you need to use etc), and then move it to the correct entity once you are done testing it (would require some testing though when you move it to the correct form).

    Hope some of this helps.

    Br.

    Halldor 


    Halldór Jóhannsson
    Monday, November 7, 2011 9:50 AM

All replies

  • As far as My understanding goes for CRM 4

    Preview mode is a simulation of the form , it doesnt excute any script

    nor does it read the ISV.Config to display Button on the form

    I guess its the same in CRM 2011

    • Proposed as answer by Philippe LEAL Friday, November 4, 2011 11:58 AM
    • Unproposed as answer by Ahmet Çankaya Friday, November 4, 2011 11:59 AM
    Friday, November 4, 2011 10:35 AM
  • As far as My understanding goes for CRM 4

    Preview mode is a simulation of the form , it doesnt excute any script

    nor does it read the ISV.Config to display Button on the form

    I guess its the same in CRM 2011

    in crm 4.0 when i want to save my javascript code i can see the changes on real time

     

    but in crm 2011  i cant test my javascript code when try to test javascript codes  cant effect andcant see the changes until i publish the form


    Software Specialist Crm
    Friday, November 4, 2011 11:06 AM
  • There is a development project included in the CRM 2011 SDK called the Xrm.Page Script Library Template.  It will allow you to write javascript with tool tip assist as well as test from the same project.  It can be a real timesaver.  Download the SDK at:  http://www.microsoft.com/download/en/details.aspx?id=24004.  The project is available in SDK\Templates\Xrm.PageScriptProjectTemplate.

    Friday, November 4, 2011 12:32 PM
  • There is a development project included in the CRM 2011 SDK called the Xrm.Page Script Library Template.  It will allow you to write javascript with tool tip assist as well as test from the same project.  It can be a real timesaver.  Download the SDK at:  http://www.microsoft.com/download/en/details.aspx?id=24004.  The project is available in SDK\Templates\Xrm.PageScriptProjectTemplate.


    thx i have installed the xrmpagescriptdevelopmentprojectcs.vsix file and it succesfully installed than i install Xrm.Page Script Development Form Snapshot on crm 2011 but when i try to open a project on online template tabs there is no Xrm.Page JScript Library Project on this tab.it says "online browsing is unavaiable" any idea?
    Software Specialist Crm
    Friday, November 4, 2011 1:11 PM
  • Hi:

    Have you published all the changes?  Are you working with an online CRM installation?  I am not sure if the solution is designed to work in that environment.

    -JayB

    Friday, November 4, 2011 1:18 PM
  • Hi:

    Have you published all the changes?  Are you working with an online CRM installation?  I am not sure if the solution is designed to work in that environment.

    -JayB

    Hello,

          1- first of all i downloaded crm 2011 sdk

    2-I install the Xrm.Page JScript Library Project For Visual C# use XrmPageScriptDevelopmentProjectCS.vsix

    3-I install the Xrm.Page Script Development Form Snapshot(Import Solution to crm 2011 it succesfully done)

    4-When I try to use this template I open visual studio 2010 pro -->new project--->When I click the online templates there is no Xrm.Page JScript Library Project i cant have any template on online templates. I dont know where i did wrong?

     


     

     


    Software Specialist Crm
    Friday, November 4, 2011 1:24 PM
  • The project template should be available locally, not online.  If you installed the C# version (as you indicate) the project template should be available in your list when you click on the 'Visual C#' item on the left under 'Installed Templates'.

    Friday, November 4, 2011 1:56 PM
  • The project template should be available locally, not online.  If you installed the C# version (as you indicate) the project template should be available in your list when you click on the 'Visual C#' item on the left under 'Installed Templates'.

    i check the list again but i couldnt find it something is wrong!

    Software Specialist Crm
    Friday, November 4, 2011 2:12 PM
  • I would:

    1. Check the Event Log to make sure there were no errors in installing the project template.
    2. Reboot.
    3. If the proj template still doesn't show, try installing again.  If you get a message that the template has been detected and is already installed you're looking for it in the wrong place.

    -JayB

    Friday, November 4, 2011 3:21 PM
  • In CRM 2011 scipts need to be written in a separate jscript web resource. This is then included in the Form. 

    After making changes to the script library publish the web resource. Then preview the form, hopefully the changes should reflect in preview mode.

    HTH

    Sam


    Web: http://www.inogic.com
    Blog: http://inogic.blogspot.com
    Email: news@inogic.com
    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    • Proposed as answer by Sam - Inogic Saturday, November 5, 2011 2:38 AM
    • Unproposed as answer by Ahmet Çankaya Sunday, November 6, 2011 11:12 PM
    Saturday, November 5, 2011 2:38 AM
  • In CRM 2011 scipts need to be written in a separate jscript web resource. This is then included in the Form. 

    After making changes to the script library publish the web resource. Then preview the form, hopefully the changes should reflect in preview mode.

    HTH

    Sam


    Web: http://www.inogic.com
    Blog: http://inogic.blogspot.com
    Email: news@inogic.com
    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    what do u mean by separate jscript web resource?

    Software Specialist Crm
    Sunday, November 6, 2011 11:12 PM
  • In CRM 2011 when you add a script you need to first create a script library. This script library is then included in the entity form where you want to add event handlers.

    The script libraries are created as web resource. after every change in script, save and publish the web resource to notice the difference in form preview mode.

    HTH

    Sam


    Web: http://www.inogic.com
    Blog: http://inogic.blogspot.com
    Email: news@inogic.com
    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    • Proposed as answer by Sam - Inogic Monday, November 7, 2011 7:38 AM
    Monday, November 7, 2011 7:37 AM
  • In CRM 2011 when you add a script you need to first create a script library. This script library is then included in the entity form where you want to add event handlers.

    The script libraries are created as web resource. after every change in script, save and publish the web resource to notice the difference in form preview mode.

    HTH

    Sam


    Web: http://www.inogic.com
    Blog: http://inogic.blogspot.com
    Email: news@inogic.com
    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    but i want to notice the difference wihtout publishing?

    Software Specialist Crm
    Monday, November 7, 2011 8:36 AM
  • Greetings,

    To the best of my knowledge the reason why you can not preview a javascript in crm 2011 is because the javascripts have moved from the form itself and are web resource objects (in crm 4.0 it was just one object (form and javascript together) but in 2011 it is 2 objects (javascript(webresource) and form (2 different objects))).

    So the form does read from the same secondary object (the webresource) either if you press preview or if you open it live, this is why you have to publish the javascript webresource on its own for it to show on the form.

    You have a few options here,

    1. ideal would be to have a dev environment set up
    2. You can surround your javascript with a user check (check if the user is you) and then remove that bit when you have finished testing the javascript and want to put it live.
    3. You can test it out on another entity if the javascript functionalitiy allows it(if it has similar fields you need to use etc), and then move it to the correct entity once you are done testing it (would require some testing though when you move it to the correct form).

    Hope some of this helps.

    Br.

    Halldor 


    Halldór Jóhannsson
    Monday, November 7, 2011 9:50 AM