-
Notifications
You must be signed in to change notification settings - Fork 6
Dynamic Application Modules
Starting in version 3.5 the application module supports dynamic loading. This means when mobile loads initially and you see the login page, your customization would NOT be loaded. When the application finishes sequences to initialize state (AppStatePromises), initModulesDynamic is fired by the Application instance, this will invoke the initDynamic function on every registered ApplicationModule. The ApplicationModule base class now has four new methods:
-
initDynamic- Entry point, invoked by theApplicationinstance. Most customizers should not worry about this method. -
loadCustomizationsDynamic- Same asloadCustomizations, except the App.context and other state initialized will be available. -
loadToolbarsDynamic- Same asloadToolbars, except the App.context and other state initialized will be available. -
loadViewsDynamic- Same asloadViews, except the App.context and other state initialized will be available.
There are certain customizations you might want to load conditionally, and might not know until runtime or the user has logged in. One common case is integrations. If you fetch all of the available integrations in your app state, you can use that to dynamically load additional views required for that integration. Since this will be so common, we added it to argos-saleslogix as part of the App.context.integrations object. The BOE integration uses this to determine if it should load:
isIntegrationEnabled: function isIntegrationEnabled() {
const results = this.application.context.integrations.filter(integration => integration.Name === 'Back Office Extension')[0];
return results && results.Enabled;
},