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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Dynamics 365 Portal - ...
Power Pages
Unanswered

Dynamics 365 Portal - Best Practice for JavaScript

(0) ShareShare
ReportReport
Posted on by

Hi All,

Thanks for reading my post.

We're doing configuration of 'Dynamics 365 Portal' for a client and we're bit confused where to maintain all of our JavaScript as per Best Practice?

 

At the moment, we have 3 viable options:-

 

  1. Option # 1: Only one 'Custom.js' web file, which has all the JavaScript of the entire portal. 
  2. Option # 2: Couple of '*.js' web files which are based on following principle:
    1. Core file - Contains functions that are used almost everywhere and other useful page things.
    2. Module files - Contains code that is used in several places, but not everywhere. 
  3. Option # 3: Write down the JavaScript in the 'Custom JavaScript' field of the Entity form / Web form.

Which approach are you guys inclined to? Or what is the Best Practice for a JavaScript based on performance & maintainability? 

 

Thanks for your time.

Categories:
I have the same question (0)
  • oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at

    Hi

     

    What I normally go for is a hybrid of your options #2.core and #3 

     

    • My "core" JS contains common functions that I might use across the Portals 
    • Then each Entity Form/Web Form/Web Page etc would have its own JS code, but normally calling whatever is generic from the core JS

    The core JS can be a Web File or a Web Template, and you can reference it in your TrackingCode content snippet so it is available in every page

     

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard