locked
Queues & Teams RRS feed

  • Question

  • Hi

     

    I'm currently trying to setup several queues, and hide the queues that each user doesn't have access to.

     

    I have the code to hide the queues done fine, I just am not sure how I can filter them by team. I can currently filter them by Business Unit, but that isn't enough for what I want. I need to be able to filter them by team.

     

    Here is the function for filtering the queues based on Business Unit:

     

    private FilterExpression NewFilterExpression(IPluginExecutionContext context)

    {

    ICrmService service = context.CreateCrmService(true);

    ConditionExpression condition1 = new ConditionExpression();

    condition1.AttributeName = "queuetypecode";

    condition1.Operator = ConditionOperator.Equal;

    condition1.Values = new Object[] {1};

    ConditionExpression condition2 = new ConditionExpression();

    condition2.AttributeName = "businessunitid";

    condition2.Operator = ConditionOperator.Equal;

    condition2.Values = new Object[] {context.BusinessUnitId};

    FilterExpression filterExpression = new FilterExpression();

    filterExpression.FilterOperator = LogicalOperator.And;

    filterExpression.Conditions.Add(condition1);

    filterExpression.Conditions.Add(condition2);

    return filterExpression;

    }

     

    Pretty standard stuff. But when I try to change the code to search for teamid, it throws an exception, saying Query invalid or something like that.

     

    Can anyone please help with this one, as I'm completely stuck?

     

    Thanks

     

    Phil

    Monday, November 17, 2008 11:04 PM

Answers

  • Your problem is that the relationships work differently. A user can only be a member of one business unit, but can be a member of many teams, so there is no teamid attribute on the systemuser entity.

     

    Rather than use a query expression, you can use either a RetrieveTeamsSystemUser or RetrieveMembersTeam request

    Tuesday, November 18, 2008 3:07 PM
    Moderator

All replies

  • Your problem is that the relationships work differently. A user can only be a member of one business unit, but can be a member of many teams, so there is no teamid attribute on the systemuser entity.

     

    Rather than use a query expression, you can use either a RetrieveTeamsSystemUser or RetrieveMembersTeam request

    Tuesday, November 18, 2008 3:07 PM
    Moderator
  • Hey

     

    Thanks for the reply. I probably should have clarified, I have no problem getting the list of teams, my issue is with Queues not having a teamid attribute. I can't seem to find a way to filter queues based on teams, rather than business units.

     

    Any ideas?

     

    Regards

     

    Phil

     

    Tuesday, November 18, 2008 9:53 PM