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