Hi all,
Please find the Plugin Code to Add and Remove Members to a Team using C#
//Add Members to Team
public static void AddMembersToTeam(Guid teamId, Guid[] membersId, IOrganizationService service)
{
// Create the AddMembersTeamRequest object.
AddMembersTeamRequest addRequest = new AddMembersTeamRequest();
// Set the AddMembersTeamRequest TeamID property to the object ID of
// an existing team.
addRequest.TeamId = teamId;
// Set the AddMembersTeamRequest MemberIds property to an
// array of GUIDs that contains the object IDs of one or more system users.
addRequest.MemberIds = membersId;
// Execute the request.
service.Execute(addRequest);
}
//RemoveMembers to Team
public static void RemoveMembersFromTeam(Guid teamId, Guid[] membersId, IOrganizationService service)
{
// Create the AddMembersTeamRequest object.
RemoveMembersTeamRequest addRequest = new RemoveMembersTeamRequest();
// Set the AddMembersTeamRequest TeamID property to the object ID of
// an existing team.
addRequest.TeamId = teamId;
// Set the AddMembersTeamRequest MemberIds property to an
// array of GUIDs that contains the object IDs of one or more system users.
addRequest.MemberIds = membersId;
// Execute the request.
service.Execute(addRequest);
}
Please find the Plugin Code to Add and Remove Members to a Team using C#
//Add Members to Team
public static void AddMembersToTeam(Guid teamId, Guid[] membersId, IOrganizationService service)
{
// Create the AddMembersTeamRequest object.
AddMembersTeamRequest addRequest = new AddMembersTeamRequest();
// Set the AddMembersTeamRequest TeamID property to the object ID of
// an existing team.
addRequest.TeamId = teamId;
// Set the AddMembersTeamRequest MemberIds property to an
// array of GUIDs that contains the object IDs of one or more system users.
addRequest.MemberIds = membersId;
// Execute the request.
service.Execute(addRequest);
}
//RemoveMembers to Team
public static void RemoveMembersFromTeam(Guid teamId, Guid[] membersId, IOrganizationService service)
{
// Create the AddMembersTeamRequest object.
RemoveMembersTeamRequest addRequest = new RemoveMembersTeamRequest();
// Set the AddMembersTeamRequest TeamID property to the object ID of
// an existing team.
addRequest.TeamId = teamId;
// Set the AddMembersTeamRequest MemberIds property to an
// array of GUIDs that contains the object IDs of one or more system users.
addRequest.MemberIds = membersId;
// Execute the request.
service.Execute(addRequest);
}
No comments:
Post a Comment