Framework: Difference between revisions

From MobileX for SageCRM
(Created page with "The Framework allows for customisation of the client side and server side (building your own API's to be consumed by the client) ---- Perform the following steps to add a ne...")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 9: Line 9:
   <CustomPlugins>
   <CustomPlugins>
     <plugins>
     <plugins>
       <add name="myPlugin" />
       <add name="PLUGINNAME" />
     </plugins>
     </plugins>
   </CustomPlugins>
   </CustomPlugins>


  2. Create subdirectory matching the name of plugin at SageCRMWS\js\plugins\myPlugin .
  2. Create subdirectory matching the name of plugin at SageCRMWS\js\plugins\PLUGINNAME.


3. The plugin directory must contain at least the file at myPlugin\client\plugin.js with following (required) callback methods:
3. The plugin directory must contain at least the file at PLUGINNAME\client\plugin.js with following (required) callback methods:


  var onDocumentReady = function() {
Called when the web application has finished loading.
        // TODO: add your custom plugin code here
  }
  var onContextChanged = function () {
 
  }


var onDocumentReady = function() {
        // TODO: add your custom plugin code here
}


onDocumentReady  - Called when the web application has finished loading.


// Called when a context in the web application has changed, as the result of calling cApp.setContext() method
onContextChanged - Called when a context in the web application has changed, as the result of calling cApp.setContext() method
var onContextChanged = function () {
        // TODO: add your custom plugin code here
}

Latest revision as of 18:40, 14 February 2019

The Framework allows for customisation of the client side and server side (building your own API's to be consumed by the client)


Perform the following steps to add a new plugin to the system:

1. Add an entry with plugin name to the <CustomPlugins> section in Web.config (in SageCRMWS project):

 <CustomPlugins>
   <plugins>
     <add name="PLUGINNAME" />
   </plugins>
 </CustomPlugins>
2. Create subdirectory matching the name of plugin at SageCRMWS\js\plugins\PLUGINNAME.

3. The plugin directory must contain at least the file at PLUGINNAME\client\plugin.js with following (required) callback methods:

 var onDocumentReady = function() {
       // TODO: add your custom plugin code here
 }
 var onContextChanged = function () {
 }


onDocumentReady - Called when the web application has finished loading.

onContextChanged - Called when a context in the web application has changed, as the result of calling cApp.setContext() method