Answered by:
CRM 2011 java script

Question
-
I have a java script that works fine in CRM 4.0. I am trying to include it in CRM 2011. I ran the script through the CRM java script converter. I added the script to CRM 2011, saved the form, published the changes. It seems to ignore the script.
CRM 2011 has a different screen, could I have added it to the wrong place? Did I not set it to active correctly? Any thing that is different that I might have missed?
Thanks
Monday, March 7, 2011 5:26 PM
Answers
-
1. Did you encapsulate the script as a function.
2. Did you put your function in a jscript library?
3. Did you attach the function to the onload event and publish?
If those are done, are you getting any jscript errors if you enable script debugging in IE from Tools, Internet Options, Advanced?
If so I would put a debugger; statement in and debug in Visual Studio.
Jamie Miley- Proposed as answer by Jamie MileyModerator Thursday, March 24, 2011 3:55 PM
- Marked as answer by Jim Glass Jr Thursday, March 24, 2011 5:40 PM
Monday, March 7, 2011 5:46 PMModerator -
You need to
1. Add your javascript as web resources.
2. Publish the web resource.
3. Add reference to your javascript web resource & function in form onload.
Refer
http://ayazahmad.wordpress.com/2010/09/25/javascript-libraries-in-microsoft-dynamics-crm-2011/
http://www.develop1.net/public/post/Speed-up-JavaScript-Web-Resource-development-time.aspx
- Proposed as answer by Jamie MileyModerator Thursday, March 24, 2011 3:55 PM
- Marked as answer by Jim Glass Jr Thursday, March 24, 2011 5:40 PM
Monday, March 7, 2011 5:47 PM
All replies
-
1. Did you encapsulate the script as a function.
2. Did you put your function in a jscript library?
3. Did you attach the function to the onload event and publish?
If those are done, are you getting any jscript errors if you enable script debugging in IE from Tools, Internet Options, Advanced?
If so I would put a debugger; statement in and debug in Visual Studio.
Jamie Miley- Proposed as answer by Jamie MileyModerator Thursday, March 24, 2011 3:55 PM
- Marked as answer by Jim Glass Jr Thursday, March 24, 2011 5:40 PM
Monday, March 7, 2011 5:46 PMModerator -
You need to
1. Add your javascript as web resources.
2. Publish the web resource.
3. Add reference to your javascript web resource & function in form onload.
Refer
http://ayazahmad.wordpress.com/2010/09/25/javascript-libraries-in-microsoft-dynamics-crm-2011/
http://www.develop1.net/public/post/Speed-up-JavaScript-Web-Resource-development-time.aspx
- Proposed as answer by Jamie MileyModerator Thursday, March 24, 2011 3:55 PM
- Marked as answer by Jim Glass Jr Thursday, March 24, 2011 5:40 PM
Monday, March 7, 2011 5:47 PM -
I need Help !!! I'm new to CRM 2011 and I can not get any of my Java Script to work. I'm trying to add a field or a Web resource with a Java Script Call and I'm getting this message every time I try to run them on any CRM 2011 Form: I get: Invalid web resource type for form
What do I do I know that it is something I'm doing wrony,, Please HELP!!!
Tuesday, March 22, 2011 6:39 PM -
I have added this fuction as a web resource and then try to add it to the form I get this ERROR
function addMessageToOnSave() {
Xrm.Page.data.entity.addOnSave(displayMessage);
}
function displayMessage() {
alert("message");
}The ERROR is: Invalid web resource type for form
What am I doing worng????
Thanks,
Jim M.
Thursday, March 24, 2011 3:40 PM -
Jim,
Please open this as a separate question in the forum.
Jamie Miley
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!Thursday, March 24, 2011 3:55 PMModerator