In the latest patches to SugarCRM version 7, you may have run into a "Data not available" error immediately after installing a module or while trying to go to your new module's end points using the Sugar App router. You may have found out that by simply refreshing the page and going back to your endpoint solves the issue. I knew there had to be something Sugar was doing on a page refresh that it wasn't doing after a module was installed.
After browsing through the many AJAX requests of Sugar 7, I found a "sync" request that loads a lot of information Sugar needs to operate, including all the available routes for your modules. Since Sugar 7 is a one-page application (meaning it uses AJAX requests for everything), after a module finishes installing through the module loader, the browser is not aware of the new routes your newly installed module added which is why the "Data not available" error is shown. Simply running a sync will solve this.
It's as simple as the script above. Once that runs, your app will know about your new routes.
One important thing to note is the callback option for the sync method. Since Javascript is the asynchronous language that it is, the sync method lets you define a javascript method to be run once the sync completes. In our post_install.php scripts, we echo out something like the code below. It will initiate the sync and once it finishes it will redirect to your license validation page. This makes the module installation progress seamless for the user.
-
Background Updater
Have calculated fields and logic hooks that your business depends on for reporting and business logic. Unfortunately those rules only run when a record is saved. Background Updater runs in the backgro...
-
Sugar Connector for Jira
FEATUREDGet a 360 degree view for your Support and Dev-Ops Teams. Give the users the ability to work and track Jira issues within Sugar.
-
ZoomInfo - B2B Data You Can Trust
FEATUREDImprove your lead acquisition process and enrich your information about prospects and customers. Leverage the power of ZoomInfo data to keep your SugarCRM Sell, Serve, Enterprise, and Professional pro...
- Show more addons