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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

creating multiple java script web resources for single entity form

(0) ShareShare
ReportReport
Posted on by

Hi,

I have created multiple multiple java script web resource libraries in solution and added libraries on single form.I want to ensure whether is it good practice to create multiple web resources ? How this will impact on performance ?

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Aiden Kaskela Profile Picture
    19,696 on at

    Hi,

    I think it's a balancing act between performance and maintainability. You don't want to load more than you need because it'll be wasteful, but you don't want to be overly-focused on performance to the point where you can't maintain your code.

    As a general rule, smaller files load faster than big ones, and the less files there are, the faster it can load.

    If you have a lot of javascript for specific entities, I would break up the web resources by entity so you're loading only what you need to, all at once. If your js is more general, like standard date manipulation, you should keep them in separate files in case you need to change the functionality, then there's only one place to do it.

    With that said, unless you're loading huge js libraries, I haven't seen much of an impact on how the js functionality is grouped.

    I hope this was a help Yeahpal, if so I would appreciate if you would mark this as the verified answer.

    Thanks!

     Aiden

  • Verified answer
    Aileen Gusni Profile Picture
    44,524 on at

    Yashpal,

    I also actually implement the same thing to make our function is modular and somehow needs to download global or common function that stored in single global javascript that must be accessed by other entities.

    So far not really affected the performance, this is for better maintenance.

    Thanks.

  • Aiden Kaskela Profile Picture
    19,696 on at

    Hi Yashpal,

    If you're running CRM 2015, javascript files are loaded in parallel, so if your js files can be loaded in any order (i.e., the don't reference each other), having them broken up won't hurt nearly as much as previous versions. It might actually be faster, but I can't find any details on that.

    Here's some more details on form load updates:

    blogs.technet.com/.../form-load-time-drastically-reduced-with-the-new-form-rendering-engine.aspx

    Thanks,

     Aiden

  • Verified answer
    Community Member Profile Picture
    on at

    Hi Yashpal,

    I would say is :

    1. You can have one JavaScript Webresources Entity wise(Eg account.js, contact.js, opportunity.js). This will help you to bifurcate the JS web-resources Entity.

    2. You can create one "CommonWebresource"  file and include all common function which are required to be used frequently. This will remove redundancy of functions in different web-resources.

    It will be good if you keep one JS web-resource i.e. specific for that entity and one Common function JS web-resource on Entity form.

    Thing need to be taken care in parallel i.e.  maintenance and performance,  The less code less time to load , less files less time.

    I have gone through various article/bogs but didn't find any thumb rule for this. Hope This helps !!


    Regards,
    Kamran

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans