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.
-
Proximity Search
Proximity searches are becoming more essential to businesses every day. Sales and marketing teams use them to organize field visits and campaigns. The real estate industry use them to offer better alt...
-
Jira Integration for Sugar by Faye
FEATUREDGive your users the ability to monitor and track Jira issues from within Sugar. Customer facing teams using Sugar can keep an eye on critical project developments affecting their customers. Jira is th...
-
Drawing and Signature Field
Need a way to have customers sign a receipt or for project managers to draw a mock-up in real time right inside of Sugar? Add drawing fields to any SugarCRM module right from within Studio. Especi...
- Show more addons