Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

Web Resource load order causing error in form

Posted on by 8
Hi,
 
I'm having a problem with my custom form for a solution I've built for Dynamics 9.1 (on-premises).
 
When I click the new Quote button on the Quotes grid on the Opportunity form, I am navigated to the Quote page and I immediately get an error popup stating "Cannot read properties of undefined (reading 'Tabs')"
 
After some investigation, this seems to be a problem with the order in which my Web Resources in my solution are being loaded into the browser for the form I have created.

There are 2 scripts in play here: (I'm simplifying the names of them slightly for this post)
Quote.Components.js
Quote.RibbonEvents.js
 
Quote.Components.js is a simple file that holds some constants for the names of the tabs, fields etc being used on that form for multiple scripts to have access to and being a centralised place I can keep those variables.
 
Quote.RibbonEvents.js has a few functions, including one being used for an enableRule I have configured for a button using the Ribbon Workbench. It has a dependency on Quote.Components.js as it uses some of the constants stored in it.
 
While debugging this in the browser I hit a breakpoint where the error is caught in Quote.RibbonEvents.js, I can see that it's because the QuoteComponents variable (set by Quote.Components.js) is undefined because that script has not been loaded by the time this enable rule is being fired.
 
I have tried several things to resolve this, including ensuring Quote.Components.js is at the top of the list of the form libraries for the scripts being used on the form, and also setting Quote.Components.js as a dependency of Quote.RibbonEvents.js within the solution. However, Dynamics still seems to fire the enable rule before the dependency is loaded.
 
Does anyone have any other ideas I can try or any pointers/suggestions for me? Anything would be greatly appreciated.
 
Cheers,
Tom.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans