gpt4 book ai didi

dynamics-crm-2011 - Dynamics CRM 2011 插件如何获取用户所属的团队

转载 作者:行者123 更新时间:2023-12-04 07:50:04 27 4
gpt4 key购买 nike

我需要检查并查看用户是否在特定团队中。我假设我必须从球队开始,但我不太确定。只查看用户所属的所有团队会更容易。有没有人有在插件中使用 N:N 关系的例子?

这是我目前的代码...

// Set the properties of the QueryExpression object.
teamQuery.EntityName = "team";
teamQuery.AddAttributeValue("name", "Team");
teamQuery.ColumnSet = teamColumnSet;

EntityCollection teamDetail = service.RetrieveMultiple(teamQuery);

foreach (var teamDetail in teamDetail.Entities)
{
teamGuid = teamDetail.Id;
}

谢谢你的帮助!!

加里

最佳答案

这是我的最终解决方案...

QueryExpression teamQuery = new QueryExpression("team");
ColumnSet teamColumnSet = new ColumnSet("name");

teamQuery.ColumnSet = teamColumnSet;
teamQuery.Criteria = new FilterExpression();
teamQuery.Criteria.FilterOperator = LogicalOperator.And;
teamQuery.Criteria.AddCondition("name", ConditionOperator.Equal, "Sales");
teamQuery.AddLink("teammembership", "teamid", "teamid").AddLink ("systemuser", "systemuserid", "systemuserid").LinkCriteria.AddCondition("systemuserid", ConditionOperator.Equal, salesRepGuid);

EntityCollection teamDetail = service.RetrieveMultiple(teamQuery);

加里

关于dynamics-crm-2011 - Dynamics CRM 2011 插件如何获取用户所属的团队,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16327584/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com