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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Ways to refer Javascript Libraries in CRM Portal

(0) ShareShare
ReportReport
Posted on by

Hi all,

I did check all the options available on the CRM portal for this and couldn't find it. Need help on this!

What is the way to reference the javascript files in CRM Portal

1. Javascript from CRM Instance

2. Javascript files from external sources like (CDN libraries, external links etc..)

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Ways to refer Javascript Libraries in CRM Portal

    Hi Sreedhar,

    please refer to the following resources:

    https://community.dynamics.com/crm/f/117/t/218907  <-- scroll to the first posted screenshot

    https://community.adxstudio.com/products/adxstudio-portals/documentation/configuration-guide/web-forms/web-form-steps/custom-javascript/ 

    https://rajeevpentyala.com/2016/09/12/useful-jscript-syntaxes-adx-portal/ 

    https://nishantrana.me/2017/02/14/using-custom-javascript-field-on-entity-form-to-add-javascript-in-portal-in-dynamics-365/ 

    http://www.toplinestrategies.com/blogs/application-development/adx-portal-dynamic-behaviors-entity-forms 

    Please let me know if you solve.

    Looking forward to hearing from you.

    If you found the answer helpful, please mark as Verified 

    Join my network on LinkedIn      Follow me on Twitter 

    Thank You & Best Regards

    Francesco Picchi

    Microsoft Dynamics CRM Consultant, Bologna+Milano, ITALY

    Independent Contractor

    http://www.francescopicchi.com

  • Aric Levin - MVP Profile Picture
    30,190 Moderator on at
    RE: Ways to refer Javascript Libraries in CRM Portal

    I am not sure about external sources like CDN libraries, but for local files you will need to do the following steps:

    - Create a web file for your JavaScript, and upload the note for it. If you are not able to upload the JavaScript file for any reason it is likely that the extension is blocked from being uploaded. You will then need to go to System Settings, and remove the .js from the list of blocked extensions.

    - In Content Snippets, create a new content snippet called Tracking Code, which will be included in the master page of the site. Add the script tag to the Tracking Code content snippet in the following way:

    <script type="text/javascript" src="/internal.js" />

    Hope this helps.

  • Suggested answer
    Nicholas Hayduk Profile Picture
    2,863 on at
    RE: Ways to refer Javascript Libraries in CRM Portal

    Hi Sreedhar,

    As Aric mentioned, if you want to include JavaScript from your CRM instance, you need to upload as a web file.  You can't easily include JavaScript that is uploaded as a Web Resource.

    As far as actually including the reference, I thought I'd mention a few additional options, in addition to the "Tracking Code" snippet.  The Tracking Code snippet was originally meant for including javascript code for things such as Google Analytics, but it can be used as Aric described, to include JavaScript for external sources, or web files.  Whatever you put in that snippet will appear near the closing body tag on all pages.

    If you need to include JavaScript higher up on the page (which is necessary if you're including libraries that you reference directly in some of the custom javascript areas in entity lists, forms, etc which are placed within the main content of the page), there is another snippet called "Head/Bottom" which will put it within the <head> tags.

    You can also include scripts via the Header or Footer "Web Templates", which appear on all pages, except if you've specifically excluded them from the page template.

    Hope that helps.

  • Mohammed Fakhri Profile Picture
    402 on at
    RE: Ways to refer Javascript Libraries in CRM Portal

    Thanks Aric. This Worked for me.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#2
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans