Just insert following code to OnLoad event handler of form like contact and account.
function OverrideClickHandler(loadAreaId, comboname)
{
var navElement = document.getElementById('nav' + loadAreaId);
if (navElement != null)
{
navElement.onclick = function()
{
loadArea('area' + loadAreaId);
SetView(document.getElementById('area' + loadAreaId + 'Frame'), comboname);
}
}
}
SetView = function(Iframe, comboname)
{
if (Iframe != null )
{
Iframe.onreadystatechange = function()
{
if (Iframe.readyState == 'complete')
{
var frame = frames[window.event.srcElement.id];
var viewCombo = frame.document.getElementById(comboname);
if (viewCombo.readyState == "complete")
{
SetDefaultView(viewCombo, "All");
}
else
{
viewCombo.onreadystatechange = function()
{
if (this.readyState == "complete")
{
SetDefaultView(this, "All");
}
}
}
}
}
}
}
SetDefaultView = function(viewCombo, viewName)
{
if (viewCombo.value != viewName)
{
viewCombo.value = viewName;
viewCombo.FireOnChange();
}
}
OverrideClickHandler("Activities", "scheduledend");
OverrideClickHandler("ActivityHistory", "actualend");
Thanks, the code worked great!
ReplyDeleteWelcome!
ReplyDelete