Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

Web Resource load order causing error in form

(1) ShareShare
ReportReport
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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,233 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,982 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans