Summary:

Adding a block to the Interactive Dashboard using an ASP page

Steps to add Content Block:

As we can see in our previous article 720-18137, We have added an ASP page in company Tab. Now in this article, we will add a content block using that ASP Page.

1. Log on to Sage CRM as Admin

Go To My Profile > Administration

Description

Click on the Customisation option

Description

Click on Company entity

Description

2. Click on Blocks and then click on New 

Description

And then use the following options:

  •     Block Name. Enter a name for your block.
  •     Block Type. Choose Content Block.

Click Save.

3. Click the new block and then from Interactive/Classic Dashboard Level choose Available in Dashboards.

Description

Add the following code into Contents, and then click Save:

<script>
if(window.addEventListener)
{
window.addEventListener('load', callPage("test.asp"));
}
else
{
window.attachEvent('onload', callPage("test.asp"));
}
function callPage(strPageName)
{
var SID = "";
var strPath = document.URL;
var protocol = window.location.protocol;
var host = window.location.host;
var arrayFullKeys = strPath.split("?");
var arrayKeys = arrayFullKeys[1].split("&");
for(var i=0; i<arrayKeys.length; i++)
{
var arrayValue = arrayKeys[i].split("=");
if (arrayValue[0].toLowerCase()== "sid")
{
SID = arrayValue[1];
}
}
var strNewPath = protocol + "//" + host + "/crm/" + "CustomPages/" + strPageName + "?SID=" + SID;
document.write("<IFRAME WIDTH=100% src='" + strNewPath + "' height=120 width=120 frameborder=0 scrolling = 'no'></IFRAME>");
}
</script>

 

We have aplied if else statement for window.addEventListener / window.attachEvent . Both methods are used to achieve the same goal of attaching an event to an element.

The difference being is that attachEvent can only be used on older trident rendering engines ( IE5+ IE5-8*) and addEventListener is a W3 standard that is implemented in the majority of other browsers (FF, Webkit, Opera, IE9+).

IE9-10 support both methods, for backwards compatibility.

4. Now go to the Dashboard > Click on New Gadget > Create Gadget > Click on Website Option

Description

5. Create the gadget and the newly created block is displayed in Available Content.

Description