As you all know “Presence” is now part of CRM 4.0. To enable presence the client machine only
needs communicator installed.
In CRM 4.0 the presence control is only enabled for contact and system user entities on some
views and inside lookups. You can read more about it here.
What I was really after is integrating presence for other CRM Form fields of type email or phone.
This was actually very simple since all you need to do is create an instance of “Name.NameCtrl“ control and show or hide it using two simple methods.
The majority of the code takes care of the positioning of the Presence on the crmForm on the right edge of each CRM field (like a lookup).
When you add presence to a field also send the tab index where the field resides for positioning purposes because crmForm scrolling is tab related.
The Presence DLL is installed with office. So if you’re having trouble seeing it,
usually running a repair on office solves the problem.
Add the code to the entity onload event
var ocs = new ActiveXObject("Name.NameCtrl");
AddPresence( "emailaddress1" , 0 );
AddPresence( "telephone1" , 0 );
function AddPresence( elementId , tabIndex )
if( typeof(ocs) == "object" )
var element = document.getElementById( elementId );
element.tab = tabIndex;
element.attachEvent( "onmouseover" , ShowOOUI );
element.attachEvent( "onmouseout" , HideOOUI );
window. attachEvent( "onscroll" , HideOOUI );
// show Messenger icons
var element = event.srcElement;
var elemVal = element.DataValue;
if( !(element && elemVal) )
var offsetX = -20;
var offsetY = -2;
for (var parent = element; parent; parent = parent.offsetParent)
offsetX += parent.offsetLeft;
offsetY += parent.offsetTop;
var scrollTop = document.getElementById("tab" + element.tab).scrollTop;
ocs.ShowOOUI(elemVal, 0, offsetX + element.offsetWidth, offsetY - scrollTop);