Skip to content
This repository was archived by the owner on Jun 16, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ public OrganizationResponse Execute(OrganizationRequest request, XrmFakedContext
Entity user = ctx.CreateQuery("systemuser").FirstOrDefault(p => p.Id == systemuserId);
if (user == null)
{
throw new FaultException<OrganizationServiceFault>(new OrganizationServiceFault(), "User with id=" + teamTemplateId + " does not exist");
throw new FaultException<OrganizationServiceFault>(new OrganizationServiceFault(), "User with id=" + systemuserId + " does not exist");
}


Entity team = ctx.CreateQuery("team").FirstOrDefault(p => ((EntityReference)p["teamtemplateid"]).Id == teamTemplateId);
Entity team = (from t in ctx.CreateQuery("team") where t.Contains("teamtemplateid") && t["teamtemplateid"] != null && ((EntityReference)t["teamtemplateid"]).Id == teamTemplateId select t).FirstOrDefault();
if (team == null)
{
team = new Entity("team")
Expand Down Expand Up @@ -82,7 +82,7 @@ public OrganizationResponse Execute(OrganizationRequest request, XrmFakedContext
Principal = user.ToEntityReference(),
AccessMask = (AccessRights)poa["accessrightsmask"]
});

return new AddUserToRecordTeamResponse
{
ResponseName = "AddUserToRecordTeam"
Expand Down