Re: Changing Filter on next xx days in related views by Stephane
Stephane
Thu Feb 22 05:01:15 CST 2007
Hi Patrice,
There's no supported way to change it in the current crm release
unfortunately.
You could change the system default behaviour by editing the
corresponding .htc file but this is totally unsuported and there's a
fair chance that the file is replaced by hotfixes, rollup and
definitely by upgrades.
This said, I had a quick look.
* warning *, be sure you take a backup of all system files you modify
as you may definitely cripple the system behaviour doing this.
The file in question is in <crm web site>\_controls_
\AppGridFilterSelector\AppGridFilterSelector.htc.
I changed the Initialize function to :
function Initialize()
{
var oEle =3D element.all["FilterControl"];
if(!IsNull(oEle))
{
_oFilterControl =3D oEle.firstChild;
_oFilterControl.attachEvent("onchange", HandleChange);
// new code start here
var oEnd =3D element.all["scheduledend"];
if(!IsNull(oEnd))
{
for (var i=3D0;i<oEnd.options.length;i++) {
if (oEnd[i].value =3D=3D 'Tomorrow')
oEnd[i].selected =3D true;
}
var evt =3D document.createEvent("HTMLEvents");
evt.initEvent("change", true, true);
oEnd.dispatchEvent(evt);
// new code end here
}
}
This change the default filter but it doesn't refresh the grid
properly, I must be doing something wrong in re-firing the change
event but couldn't figure it right away.
nb: Even when the event is refired properly, it is not an ideal code
as the grid is loaded twice.
Anyway, I hope it can gives you directions how to do it.
Have a nice day,
St=E9phane.