Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

Problem using AddMembersTeamRequest

$
0
0

I have a problem using AddMembersTeamRequest 

My scenario as follow,

I have a List which I converted to array and pass it to AddMembersTeamRequest.

code snippet:

 Guid[] userIDToArray = userID.ToArray(); 

//where userID is a list.

//Then I pass userIDToArray to AddMembersTeamRequest

 AddUserToTeam(userIDToArray, _teamID);

private static void AddUserToTeam(Guid[] memberID, Guid teamID)
{
AddMembersTeamRequest addRequest = new AddMembersTeamRequest();
addRequest.TeamId = teamID;
addRequest.MemberIds = memberID;
_service.Execute(addRequest);
}

However, when the code is run, it said the "The user Id is invalid",

But if I have my code as follow, the AddMembersTeamRequest runs smoothly.


Guid user1Id = new Guid("1c0acaga3-9ad4-f521-50f6-3823bb33ad90");
Guid user2Id = new Guid("1f54e519-17ef-e521-50e0-3863cb365d28");


Guid[] members = new[] { user1Id, user2Id };

AddUserToTeam(members, _teamID);

Any clues of what have gone wrong in my code for the List to array?


Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>