Personalized Community is here!
Quickly customize your community to find the content you seek.
Choose your path Increase your proficiency with the Dynamics 365 applications that you already use and learn more about the apps that interest you. Up your game with a learning path tailored to today's Dynamics 365 masterminds and designed to prepare you for industry-recognized Microsoft certifications.
Visit Microsoft Learn
2020 Release Wave 2Discover the latest updates and new features to Dynamics 365 planned through March 2021.
Release overview guides and videos Release Plan | Preview 2020 Release Wave 2 TimelineWatch the 2020 Release Wave 1 virtual launch event
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Upcoming TechTalks
I have a java script function on load of the form which eventually calls - formContext.getAttribute("new_fieldame").addOnChange(fucntionname).
But on load of new lead form or existing lead form, following error is occurred -
formContext.getAttribute(...).addOnChange is not a function
This error was not occurring on other environment (having same JS, same form), however I could reproduce it by removing that field 'new_fieldname'.
On-load function gets called when complete form is loaded. However, I think the field is not getting loaded here.
Any idea about the occurrence of this error?
Thanks in advance.
You could check whether "new_fieldname" is actually the logical name of that field.
I recommend to use Level up for Dynamics 365/Power Apps plugin of Chrome, after the plugin has been installed,
click the "logical name" menu to get logical name of all fields of form quickly.
I have checked the field name and 'new_fieldname' is the logical name of the field.
Can you confirm that field is available on the form? Without field available on the form getAttribute will return null so your code will fail.
I have the field on header of the form and not anywhere else on form. However I am accessing it with 'new_fieldname' only (instead of header_new_fieldname). It works on one environment, form gets loaded properly. But, it fails on another environment (replica of the 1st environment) where I get above mentioned error.
My recommendation - place it somewhere on the form and uncheck "Visible" checkbox in the properties - that should fix your issue.
Business Applications communities