05 November 2007

Microsoft CRM: Filter On: Last 30 days

I have been asked how to change the default Filter On from 'Last 30 days' to 'All' in History associated view.

Micrsoft CRM doesn't provide this customisation, and there are no good solutions on the Internet. After 3 hours research for the source, I found a simple solution:
The file you need to modify is: \CRMWeb\_controls\AppGridFilterContainer\AppGridFilterContainer.htc

Open the file by notepad, and search the string : oCallback(oCtrl);
Just add some code above it:


if(oCtrl.DataValue=="LastXDays;30")
{
oCtrl.DataValue = "All";
RefreshGridView();
}

oCallback(oCtrl);


Save and Close, that's it. Next time when you open History, you will see the change.

14 comments:

  1. What do you think about this during a CRM 4.0 upgrade. Will it stick? or Will we have do build a similar work around.

    ReplyDelete
  2. This worked like a charm.

    ReplyDelete
  3. Yup, works great. How about the same trick "next 30 days"? I'm guessing the data value for that one is not Next30Days because that one isn't working for me.

    ReplyDelete
  4. Anonymous2:52 pm

    Anyway to get this to work on CRM 4.0? The file is in under the _static folder in this version. I tried your edit but it didn't work.

    ReplyDelete
  5. Anonymous10:49 am

    Hiya,

    I've carried out the instructions but it still only shows the "last 30 days", I've checked, checked and re-checked with no joy here is the last few lines of the file:


    for(var i = 0; i < iLen; i++)
    {

    oCtrl = element.all[i];


    if(!IsNull(oCtrl.DataValue))
    {

    if(oCtrl.DataValue!="LastXDays;30")
    {
    oCtrl.DataValue = "All";
    RefreshGridView();
    }

    oCallback(oCtrl);


    i += oCtrl.all.length + 1;
    }
    }
    }


    Where am I going wrong?

    Regards,
    David

    ReplyDelete
  6. Anonymous10:50 am

    the line that reads:

    if(oCtrl.DataValue!="LastXDays;30")

    is actually:

    if(oCtrl.DataValue=="LastXDays;30")

    Regards,
    David

    ReplyDelete
  7. Anonymous10:18 am

    Hi,

    I tried to change the code (CRM 4)
    but it does not work...? Any idea?

    Thanks

    Torsten

    for(var i = 0; i < iLen; i++)
    {

    oCtrl = element.all[i];


    if(!IsNull(oCtrl.DataValue))
    {


    if(oCtrl.DataValue=="LastXDays;30")
    {
    oCtrl.DataValue = "All";
    RefreshGridView();
    }

    oCallback(oCtrl);





    i += oCtrl.all.length + 1;
    }
    }
    }

    ReplyDelete
  8. Anonymous7:04 pm

    Don't forget to clear your IE cache!

    ReplyDelete
  9. Anonymous10:09 pm

    酒店經紀PRETTY GIRL 台北酒店經紀人 ,禮服店 酒店兼差PRETTY GIRL酒店公關 酒店小姐 彩色爆米花酒店兼職,酒店工作 彩色爆米花酒店經紀, 酒店上班,酒店工作 PRETTY GIRL酒店喝酒酒店上班 彩色爆米花台北酒店酒店小姐 PRETTY GIRL酒店上班酒店打工PRETTY GIRL酒店打工酒店經紀 彩色爆米花

    ReplyDelete
  10. 3/23/10 on version 4.0 of CRM

    This worked great for me, History now says ALL instead of Last 30 Days.

    Now can you tell me how to change Activities from Next 30 Days to ALL?

    Thanks,
    Cindy

    ReplyDelete
  11. 3/23/10 on version 4.0 of CRM

    This worked great for me, History now says ALL instead of Last 30 Days.

    Now can you tell me how to change Activities from Next 30 Days to ALL?

    Thanks,
    Cindy

    ReplyDelete
  12. can any one tell me how to change Activities default from Next 30 Days to ALL? I do see how to this for the hisotry but not activities

    ReplyDelete
  13. Anonymous1:16 pm

    how does that work on 2011 ?
    on the open activities there is the 30 days filter and the users hate that filters ...

    ReplyDelete