You are viewing limited content. For full access, please sign in.

Question

Question

SDK AddMembersToGroup

SDK
asked on September 14, 2015

I'm trying to run the following script example sdk ,

 

AccountInfo AI = Account.GetInfo("New Group", mySess);
AccountReference AR = new AccountReference(AI);
List<AccountReference> list = new List<AccountReference>();
list.Add(new AccountReference("New User", mySess));
list.Add(new AccountReference("Admin", mySess));
list.Add(new AccountReference("Sales Group", mySess));
Account.AddMembersToGroup(AR, list, mySess);

 

and I have the following error:

Unable to cast object of type 'System.Collections.Generic.List`1[Laserfiche.RepositoryAccess.AccountReference]' to type 'System.Collections.Generic.IEnumerable`1[System.String]'.

0 0

Answer

SELECTED ANSWER
replied on September 16, 2015 Show version history

The answer is.......

 

        Dim infoGrupo As AccountInfo = Account.GetInfo("New Group", mySess)
        Dim ref As AccountReference = New AccountReference(infoGrupo)

        Dim ListUser As List(Of String) = New List(Of String)
        ListUser.Add("myuser")
        ListUser.Add("myuser2")
        ListUser.Add("myuser3")
        Account.AddMembersToGroup(ref, ListUser, mySess)

 

0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.