100 likes | 244 Views
Customizing CRM System Pages with ‘Io for Sage CRM’ Presented by ‘Marc Reidy’. Io for Sage CRM Open Source Hosted on Google Code http://code.google.com/p/io-for-sage-crm / Installs as a CRM component Is a Framework for development Eases the pain of upgrades.
E N D
Customizing CRM System Pages with ‘Io for Sage CRM’ Presented by ‘Marc Reidy’
Io for Sage CRM Open Source Hosted on Google Code http://code.google.com/p/io-for-sage-crm/ Installs as a CRM component Is a Framework for development Eases the pain of upgrades
Add Script to a page CompanyBoxlong-Custom content <script> $(document).ready(function () { $.getScript("../custompages/ioforsagecrm/io.js"); $.getScript("../custompages/ioforsagecrm/yourcompany.js"); }); </script> CRMIO is the name of the object For older versions of CRM you will need to include jquery
Within our custom client JS file (and not Io.js) we add the following yourcomany.js $(document).ready(function() { waitForCRMIO();//call our load function }); function waitForCRMIO(fieldName){ if(typeof CRMIO !== "undefined"){ yourcompanyIO(); } else{ setTimeout(function(){ waitForCRMIO(fieldName); },250); } }
yourcompany.js function yourcompanyIO() { if(CRMIO.getScreenMode("comp_name")==0) { CRMIO.insertData("Loading data...",0); //file is the file that contains the dispatcher actions to use //dispaction is the action in the server file varurl=CRMIO.buildUrl("ioforsagecrm/yourcompany.asp")+"&1=1&file=crmtogether&dispaction=piechart"; CRMIO.getData(url2,CRMIO.insertData,0, “piechart"); } }
yourcompany.asp Specified in yourcompany.js var url2=CRMIO.buildUrl("ioforsagecrm/dispatcher.asp")+"&1=1&file=yourcompany&dispaction=piechart"; The buildUrl method is a client-side method to create a CRM url. The dispatcher.asp file opens the querystringfile and called the dispaction. if (dispaction=="piechart") { ……execute the code yourcompany.asp can handle many actions.
yourcompany.asp – dispaction code varcompid=CRM.GetContextInfo("company","comp_companyid"); varstrSQL = "select oppo_stage as Stage, count(oppo_stage) as CountOfStage from opportunity "+ " where oppo_primarycompanyid="+compid+ " group by oppo_stage"; varchartblock=CRM.GetBlock("chart"); chartblock.DisplayForm=false; with(chartblock) { SQLText= strSQL; Stylename("Pie"); xlprop="Stage"; yprop="CountOfStage"; ImageWidth=500; } Response.Write("<span class='InfoContent'>Opportunities</span><div>"+chartblock.Execute()+"</div>");
Result Graph that is loaded into CRM system page using AJAX Ensures that CRM is upgrade safe and removes the need to over-ride the CRM system page
Io for Sage CRM Hosted on Google Code http://code.google.com/p/io-for-sage-crm/ Email sagecrm@crmtogether.com for the deck