web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Upgrade from CRM 4.0 to 2011 Javascript

(1) ShareShare
ReportReport
Posted on by

PLEASE REPLY TO THIS POST SO THAT I CAN ATTACH SCREEN CAPTURES

Hi everyone,

We are upgrading CRM 4.0 to 2011.

Scenario -

In CRM 4.0 , we have a common JS file located in the project "abc.def.crm.web" and it is referred by every custom entity on the "onLoad" event.

  • "MyJavascript.JS " has around 35 functions.
  • Each entity uses at max two or three functions from this "myJavascript.JS" file.
  • According to the info in "onLoad"event , this JS file is placed at - "/../ISV/MyProject/MyJavascript.JS" (see Screen capture ), each Onload event uses this file as source file.

Screen Capture -1

Above is CRM 4.0 Custom entity's OnLoad event -- JS file is in ISV folder

Screen Capture - 2

Above is the Screen Capture of Visual Studio, just to show the location of the JS file.

Problem/Issue-

We have now upgraded to CRM 2011.

A default Web Resource/Library has been AUTOMATICALLY added to the OnLoad event of every custom entity (because of the Upgrade) See Screen Capture below-
Screen Capture - 3

When I open "_application_main_library.js", I see the old code that we used for CRM 4.0 -
Screen Capture - 4

Brief -

Crm 4.0 used to support a JS file from a common location i.e - ISV folder.
CRM 2011 doesn't support ISV folder/ A common location.
I have common JS file, all entities HAVE TO refer it, and use two or three functions from it. (eg - "HideTab()", definition for this function is in the Common JS file -- MyJavascript.JS)

  • How can I make every entity to refer to that common file on OnLoad Event?
  • Can I convert this file to a Web Resource and make each entity use it? But the problem here is that I want each entity to use only two, three functions from a list of 35 functions .


Pleas help.

POSTING SCREEN CAPTURES IN REPLY TO THIS BECAUSE OF SIZE CONSTRAINTS

Please contact me for any clarifications

Thanks in Advance

Sagar

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at

    Hello,

    How can I make every entity to refer to that common file on OnLoad Event?

    Can I convert this file to a Web Resource and make each entity use it? But the problem here is that I want each entity to use only two, three functions from a list of 35 functions.

    -- Simple & supported answer is: Create a java script web resource and add this to every entity, so that they can call whatever method they require.

    Thanks

  • Community Member Profile Picture
    on at

    Thanks for the suggestion, but image hosting sites are not allowed :(

    Anyways -  here is screen 1 -- >  4375.1.jpg

  • Community Member Profile Picture
    on at

    Screen 2 -->0334.3.PNG

    Screen 3 -->0334.3.PNG

    Screen 4 -->7268.5.PNG

  • Community Member Profile Picture
    on at

    Thanks HIMBAP for the suggestion, but this thing is already been done automatically by the CRM.

    Checkout the Screenshot.

  • Community Member Profile Picture
    on at

    Guido Preite, HIMBAP,

    Please see Screen 4.

    Its CRM 2011. See the source for the JS file in "script.src" .   It refers to JS file. But, how to make it functional in CRM 2011,Cm 2011 uses web resources.

  • Mahendar Pal Profile Picture
    45,095 on at

    Hello,

    In case of CRM 2011, you won't write any code loading because now your script is part of the CRM (as said you need to have your common library as javascript web resource), so remove this code and simply calling methods which is available in common library (make sure it is attached before the web resource where you are calling it)

    Any confusion ping back

    Thanks

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
ScottDurow Profile Picture

ScottDurow 2

#2
GJones Profile Picture

GJones 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans