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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Error with Fields Cust...
Power Pages
Answered

Error with Fields Customized Event

(0) ShareShare
ReportReport
Posted on by 63

I've been getting an error when I open my Website Information in Dynamics 365 Portals. The Error is attached but it says the following:

 

There was an error with this field's customized event.

Field:window

Event:onload

Error:Unable to get property 'length' of undefined or null reference

 

I was able to find the window.onload function in the Header Template source, however there is no call to get the length property (Screenshot of this code is also provided). I've changed some code in other places but have not touched this. I also tried reverting all of my changes to see where this issue occurred but it persisted no matter what I changed.


I don't understand what's going wrong here and have no idea how to move forward with fixing it. Any help would be appreciated!

Categories:
I have the same question (0)
  • JonahPincetich Profile Picture
    63 on at

    Well, I was able to fix it with help from this forum post: Link 

     

    TL;DR:

    I went to the Website Form Editor (Found in the ellipses at the top of the screen).

    Clicked on Form Properties in the top ribbon

    At the bottom chose Control: Form and Event OnLoad

    Selected the on one Library item in this selection, and selected Edit Library

    Found that length was from an options variable which was being used in this for loop:  for (var i = 0; i < options.length; i++) { ... }
    I added a check around this loop: if (options != null) { for (var i = 0; i < options.length; i++) { ... } }

    Error fixed!!

     

    Still not sure what I did to cause this error so if anyone has any insight into what would cause this please leave a comment! Hope this helps someone else!

  • JonahPincetich Profile Picture
    63 on at

    Discovered this does not fix the problem but instead only silences the alert.

     

    Becuase of this issue I know of two things that cannot be done:

    Load the iFrames of an Entity List

    Add a language to the Portal

     

    Both of these resources seem to use the length property at some point and fail because it's null. I was able to discover this using the inspect tool on chrome.

     

    Does anyone know how to fix this? Where is this value from?

  • Verified answer
    JonahPincetich Profile Picture
    63 on at

    I know I'm just talking to myself here but someone at some point will find this useful.

     

    This is an issue when accessing the site through my companies CRM/Dynamics 365, but it is not an issue when I go through the PowerApps app "Dynamics 365 Portals".

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 70 Super User 2025 Season 2

#2
Jerry-IN Profile Picture

Jerry-IN 55

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard