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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

New UI Refresh button on forms does not trigger formload event

(0) ShareShare
ReportReport
Posted on by

It appears that in the new UI the new refresh button on forms does not trigger the form load event. I can't find any event to subscribe to to deal with it either. I have a html web resource on the form that I need call javascript on when certain fields change (working) or when the refresh button is clicked (not working). If you click the refresh button then the web resource is also refreshed but I need to call javascript on it again so that it can get access to the formcontext object again.

I have the same question (0)
  • LeoAlt Profile Picture
    16,331 Moderator on at

    Hi Partner,

    I did a simple test in my instance, I have an alert function on onLoad event on form, when click "Refresh" ribbon, the alert will also be triggered.

    Did you put the javascript in your html web resource on the form and when loading the form, call the JS functions in it?

    Could you kindly share your code and more details about the situation?

    Regards,

    Leo

  • Verified answer
    Community Member Profile Picture
    on at

    After more debugging. I'm going to say this is NOT what is going on. The form load event is firing.

    My actual issue is that on Chrome\Edge (but not on FireFox) the html web resource is getting reloaded after the form load by just a couple milliseconds. So that my code is running but then the web resource refreshes afterward. I fixed it by adding a timeout. I had thought that the getContentWindow() call would handle this, but apparently not.

    I had to add the setTimeout call in the following code to make it work.

    function formLoad(context)

    {

    var formContext = context.getFormContext();

    var productOptionsIFrame = formContext.getControl('WebResource_ProductOptionPicker');

       if (productOptionsIFrame) {

               setTimeout(function () {

                   productOptionsIFrame.getContentWindow().then(function (w) {

                       w.RefreshOptionPicker(Xrm, formContext);

                   }

                   ); // force reload

               }

               , 1000);

           }

    }

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Nagaraju_Matta Profile Picture

Nagaraju_Matta 123

#2
Hamza H Profile Picture

Hamza H 96 Super User 2026 Season 1

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 66 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans