ListPage filter on Team select

I have a list on a tab under Team CRM. The list filters easily for the current user. If the current user has access to more than one team and they change the team drop down in the context area, how can I filter my list in .NET by the selected field as it isn't channel ID on the current user?

Thanks.

  • 0

    Hi Lee, you can get the currently selected team by using the GetContextInfo. For a ListPage class something like the below will work(if the list is for opportunities):

    int iDomKey = Keys[(int)Sage.KeyList.DominantKey];

    switch (iDomKey)

    {

    case 4:

    FilterByField = "oppo_assigneduserid";

    FilterByContextId = (int)Sage.KeyList.UserId;

    break;

    case 5:

    int channelId = Convert.ToInt32(GetContextInfo("channel", "chan_channelid"));

    if (channelId != 0)

    {

    FilterByField = "oppo_channelid";

    FilterByContextId = (int)Sage.KeyList.ChannelId;

    }

    break;

    default:

    FilterByField = "oppo_assigneduserid";

    FilterByContextId = (int)Sage.KeyList.UserId;

    break;

    }

    Obviously if its just a Web inherited class you would just need the

    int channelId = Convert.ToInt32(GetContextInfo("channel", "chan_channelid"));

    and then do with it what you would like.