Wednesday 5 December 2012

Display Closed Activities Related to Account entity for selected record from HomePage grid MSCRM 2011

Hi,
Recently i had a requirement where my customer wanted ti view all the closed activity of an Account , which is available inside the record, but they wanted to have a view of that in HomePageGrid "Custom Button Click" . Workaround done are:
Steps:
1) Create a custom button in HomePageGrid and add CRMParameter "FirstSelectedItemId" , if u  r not familiar how to add button follow the below link which describes how to add button and paramters using RibbonWorkBench tool
http://www.develop1.net/public/page/Ribbon-Workbench-for-Dynamics-CRM-2011.aspx
2) Create a WebResource in ur CRM and add the below gicen Snippet code of JavaScript

function loadActivity(id)
{
//id returns with flower braces ("{,}") to remove that we use substring
var guid =id.substring(1,37)
//pass the id retrieved in ur function as a paramter to the url
var path1="http://SERVER URL/ORGNAME/userdefined/areas.aspx?navItemName=Closed%20Activities&oId=%7b"
var path2="%7d&oType=3&pagemode=iframe&security=852023&tabSet=areaActivityHistory"
var path3=path1+guid+path2;
//load the closed activity in a new window
window.open(path3,'',height=100,width=600,resizable=1)
 }

3) Call this javascript on ur button click (Follow Step 1)
4) Publish customisation
5) Select a record from HomePage Grid , u can view related closed activities of that Account


Hope it is helpful 



No comments:

Post a Comment