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 :
Customer experience | Sales, Customer Insights,...
Answered

How to check if a page is loaded completly

(0) ShareShare
ReportReport
Posted on by 120

I need to triger a function when my page is load completely 

readyState === "complete"

How do I do that? should I use event listener ?

would be happy to get an example.

I have the same question (0)
  • Suggested answer
    Abdul Wahab Profile Picture
    12,119 Moderator on at
    RE: How to check if a page is loaded completly

    Hi damka,

    Did you check the link; https://stackoverflow.com/questions/48259669/how-to-make-sure-load-complete-in-crm-page?

  • Verified answer
    Naveen Ganeshe Profile Picture
    3,397 User Group Leader on at
    RE: How to check if a page is loaded completly

    you can use the formContext.data object to check if a page is fully loaded. The formContext.data object has a getIsLoading() method that returns a Boolean value indicating whether or not the page is still loading.

    Here's an example of how you can use the formContext.getIsLoading() method to check if a page is fully loaded:

    var intervalId = setInterval(function(){
        if(!formContext.data.getIsLoading()){
            // Page is fully loaded
            clearInterval(intervalId);
            // Perform additional actions after the page is loaded
        }
    }, 1000);

    In this example, the setInterval function is used to check the formContext.data.getIsLoading() method every 1 second. Once the page is fully loaded and the getIsLoading() method returns false, the clearInterval function is called to stop the interval and the additional actions that you want to perform after the page is loaded can be implemented.

    It's important to note that when you are creating forms or web resources that interact with the form, you should wait for the form to be fully loaded before interacting with the form controls to avoid any errors or unexpected behaviors.

    Additionally, Dynamics 365 CRM also fires events when a form is loading, saving, closed and so on, that you can use to check the state of the form and perform specific actions accordingly.

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 117 Super User 2025 Season 2

#2
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 115

#3
Erin Lubben Profile Picture

Erin Lubben 66

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans