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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Dynamics 365 general forum

Can anyone tell me how to call a javascript function in another javascript file on form load event in dynamics 365

(0) ShareShare
ReportReport
Posted on by

Hi All,

I have a common javascript library. It contains all the general methods like EnableTab, DisableSection,... I want to call the common javascript functions in another javascript class. Anyone can explain with some examples.

I added the library in onLoad event of the form, but it is showing 'function not defined' error.

5516.Capture.PNG

Thank You,

Krishna

I have the same question (0)
  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    33,628 on at

    Hi,

    Make sure your common library is running first before your code is running. ( move up the common library above the normal JS file)

    Sample

    webresource1.js

    function HelloWorld()

    {

     alert('Hello, world!');

    }

    webresource2.js

    //should alert 'Hello, World!' using the method from the other webresource

    HelloWorld();

  • Suggested answer
    Emre GULCAN Profile Picture
    2,379 on at

    Hi,

    Firstly, your all libraries must be ordered on "Form Libraries", I guess you did it correctly.

    However you should check for "web resource dependencies" on docs.microsoft.com/.../web-resource-dependencies , Dynamics CRM TurboForms load webresources async and if your main library loading before utility library an exception occurs and you see "function is not defined"

  • Community Member Profile Picture
    on at

    The common library is above the main library.

  • Community Member Profile Picture
    on at

    Hi Emre GULCAN,

    I am using on-premise application. I have gone through the url, it is available in '365 online'.

    Thanks,

    Krishna

  • Emre GULCAN Profile Picture
    2,379 on at

    Hi,

    I'm not sure but maybe this can help you www.powerobjects.com/.../new-form-rendering-engine-in-dynamics-crm-2015

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Dynamics 365 general

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans