Io for Sage CRM

Download Report

Transcript Io for Sage CRM

Customizing CRM System Pages
with ‘Io for Sage CRM’
Presented by ‘Marc Reidy’
NY Headquarters
___
5432 Any Street West,
Townsville, State 54521
T. 555.543.5432
F. 555.543.5531
www.macmillan.com
Io for Sage CRM
Open Source
Hosted on Google Code
http://code.google.com/p/io-forsage-crm/
Installs as a CRM component
Is a Framework for development
NY Headquarters
Townsville, State 54521
___
Eases the pain of upgrades
5432 Any Street West,
T. 555.543.5432
F. 555.543.5531
www.macmillan.com
Sample customization of CRM
Company Page
NY Headquarters
___
5432 Any Street West,
Townsville, State 54521
T. 555.543.5432
F. 555.543.5531
www.macmillan.com
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
NY Headquarters
___
5432 Any Street West,
Townsville, State 54521
T. 555.543.5432
F. 555.543.5531
www.macmillan.com
Within our custom client JS file (and not Io.js) we
add the following
yourcomany.js
$(document).ready(function() {
waitForCRMIO();//call our load function
});
Townsville, State 54521
___
function waitForCRMIO(fieldName){
if(typeof CRMIO !== "undefined"){
yourcompanyIO();
}
else{
setTimeout(function(){
waitForCRMIO(fieldName);
},250);
NY Headquarters
}
5432 Any Street West,
T. 555.543.5432
}
F. 555.543.5531
www.macmillan.com
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
var
url=CRMIO.buildUrl("ioforsagecrm/yourcompany.asp")+"&1=1&file=cr
mtogether&dispaction=piechart";
CRMIO.getData(url2,CRMIO.insertData,0, “piechart");
}
}
NY Headquarters
___
5432 Any Street West,
Townsville, State 54521
T. 555.543.5432
F. 555.543.5531
www.macmillan.com
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 querystring file and called
the dispaction.
if (dispaction=="piechart")
{
……execute the code
yourcompany.asp can handle many actions.
NY Headquarters
___
5432 Any Street West,
Townsville, State 54521
T. 555.543.5432
F. 555.543.5531
www.macmillan.com
yourcompany.asp – dispaction
code
var compid=CRM.GetContextInfo("company","comp_companyid");
var strSQL = "select oppo_stage as Stage, count(oppo_stage) as
CountOfStage from opportunity "+
" where oppo_primarycompanyid="+compid+
" group by oppo_stage";
var chartblock=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>");
NY Headquarters
___
5432 Any Street West,
Townsville, State 54521
T. 555.543.5432
F. 555.543.5531
www.macmillan.com
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
NY Headquarters
___
5432 Any Street West,
Townsville, State 54521
T. 555.543.5432
F. 555.543.5531
www.macmillan.com
Io for Sage CRM
Hosted on Google Code
http://code.google.com/p/io-forsage-crm/
Email [email protected]
for the deck
NY Headquarters
___
5432 Any Street West,
Townsville, State 54521
T. 555.543.5432
F. 555.543.5531
www.macmillan.com