Archive for the ‘crm grid’ Category

What is icrm One Click Activity?

Wednesday, December 9th, 2009

One Click Activity enables user to create crm activities for an entity from the entity grid in a single click.  You no longer need to open the entity first and then add the activity or create an activity and search for the entity.   One Click Activity create activity toolbar button in the entity’s grid. 

icrmOneClickContact

These button show up in both the main grid, associate grid and the advanced find.  This enables users the option to work from list a list in the grid.

 icrmOneClickAssocitateGrid

icrmOneClickAdvanceFind 

One Click Activity is easy to configure.  Use One Click Activity login form to log into you Microsoft Dynamics CRM with an account that has customization rights.  You can log into “On-premise”, “Internet facing”, or “live”.  You do not need direct access to the server.  You then just choose your entity (Account, Contact, Opportunity, Lead, and Incident) and click the activities you would like to add (Phone Call, Task, Email, Fax, Letter, Appointment, and Service Appointment).

icrmOneClick

Make sure that the users belong to a security role that has ISV Extensions enabled.  One Click Activity will work online, in outlook and outlook offline just make sure your System Setting is configured to show ISV.Config in all these places. 

 

Please comment about what other actions you would like to see added to One Click Activity.  Please contact us at  www.icrm.ca if there is a custom project you would like done.

Creating A Following Associated Grid

Friday, October 30th, 2009


Here is an example of how to create a follwing associated gird on a entity form. The idea here is to put two embedded grids on the form and relate one to the other. An embedded grid is an associated grid embedded in an iFrame. This is great is a great way to see associated records without having to navigate to the associated view. To learn about embedded grids see Customer Effective Blog. The next step is to capture the “onselectionchange” event of the first grid and pass this id and type to the second grid. To learn about “onselectionchange” event see More CRM Grid Goodies: Detecting Click Event by Customer Effective Blog.

Here is how it is done.

First add a parent iFrame and a child iFrame to the form. These will hold the embedded grids, set the src to “about:blank”. Now will start adding code to the On_Load event of the form.

function GetFrameSource(tabSet)
{
if (crmForm.ObjectId != null)
{
var oId = crmForm.ObjectId;
var oType = crmForm.ObjectTypeCode;
var security = crmFormSubmit.crmFormSubmitSecurity.value;
return “areas.aspx?oId=” + oId + “&oType=” + oType + “&security=” + security + “&tabSet=” + tabSet;
}
else
return “about:blank”;
}
}

crmForm.all.IFRAME_parent.src = GetFrameSource(”new_new_maxexchangeserver_new_remoteaddressbo”);

The GetFrameSource function get the url for the current form for the set tabSet.

function GetFrameSourceID(oId, oType, tabSet)
{
if (crmForm.ObjectId != null)
{
var security = crmFormSubmit.crmFormSubmitSecurity.value;
return “areas.aspx?oId=” + oId + “&oType=” + oType + “&security=” + security + “&tabSet=” + tabSet;
}
else
{
return “about:blank”;
}
}

The GetFrameSourceID get the url for the parent grid row. You need to pass the id of the current entity in the grid as well as the typeid of the entity.

var bFired = false;
GridClick = function()
{
// check to see if this event has been fired already
if(bFired == false)
{
var frameDoc = document.getElementById(”IFRAME_parent”).contentWindow.document;
var crmGrid = frameDoc.all['crmGrid'];
var a = crmGrid.InnerGrid.SelectedRecords;
if (a.length > 0)
{
//Get the url to set for the child grid. Note we are always using the first selected value if more than one is selected.
crmForm.all.IFRAME_child.src = GetFrameSourceID(a[0][0],a[0][1],”new_new_remoteaddressbook_new_maxexchangepack”);
}
bFired = true;
}
else
{
// toggle our fired flag back
bFired = false;
}
}

The GridClick function will be called each time a row is selected.

AttachGridEvent = function()
{
if(crmForm.all.IFRAME_parent.readyState == “complete”)
{
var frameDoc = document.getElementById(”IFRAME_parent”).contentWindow.document;
frameDoc.all['crmGrid'].InnerGrid.attachEvent(”onselectionchange”, GridClick);
GridClick();
}
}
crmForm.all.IFRAME_parent.onreadystatechange = AttachGridEvent;

The AttachGridEvent attaches the GridClick event to the grid onselectionchange event. The challange here is we can not attach to the grid in the iFrame until the grid is loaded (readyState == “complete”). To do this we attach the GridClick event on the change of ready state and only add it if the readyState == “complete”.