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 :
Dynamics 365 general forum

JavaScript not loading on the OnLoad Event of the form in the new UI

(0) ShareShare
ReportReport
Posted on by 147

Dear Community,

I am struggeling with the issue that my custom JavaScript on the "email" form (OnLoad) is not available in the new UI. However everything is fine when I look at the form using the old interface.

My script is pretty simple, in order to test this behaviour I just created a JavaScript webresoure named mp_test.js with the following lines of code:

var Sdk = window.Sdk || {};
(function () {
    // Code to run in the form OnLoad event
    this.formOnLoad = function (executionContext) {
    alert("Hello");}
}).call(Sdk);

On the form I added the script to the library and defined the function that should be called on the OnLoad event: Sdk.formOnLoad handing over the ExecutionContext and activating it.

Once I open the form in the old interface, the alert message is showing. However, nothing happens in the new UI. I can't even find the script in the developer tools when using the new UI, meaning that it hasn't even been loaded.

Does anyone has experienced similar issues? I did test the script on another entity as well, with the exact same results.

I would appreciate any comments regarding this matter.

Thank you very much and best regards,

Philipp

I have the same question (0)
  • Verified answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi Phillip,

    As per documentation it's should work in new UI.

    Are you getting any error? If yes please share.

    Please have a look below reference -

    docs.microsoft.com/.../walkthrough-write-your-first-client-script

  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi,

    Did you try new browser/ incognito mode? As you can't find the file, I doubt its a caching issue.

    Hope this helps.

  • Rajeshvarma Profile Picture
    40 on at

    Hi Philip,

    I am also facing same issue.On Form load script is not working.any workaround you found for this?

    Thanks,

    Rajesh

  • Rajeshvarma Profile Picture
    40 on at

    I Followed the Microsoft document.and sorted issue my own.

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