0

I am using one list and it has one person field configured for "All Users".

So when i type some email ID in that person field, it is getting user and it works well.

But when i wants to add new record through client object model, some users are not available in UserinformationList in c# and Javascript as well.

Here is the code which i am trying to get all users list.

ClientContext clientContext1 = new ClientContext(SiteUrl);
clientContext1.AuthenticationMode = ClientAuthenticationMode.Default;
UserCollection usrdd = clientContext1.Web.SiteUsers;
clientContext1.ExecuteQuery();
Sathish
  • 159
  • 1
  • 4
  • 18

1 Answers1

1

A user entry is only present in that list if it's added to anything within that site collection (a group, a list, a web, etc.).

You can use SPWeb.EnsureUser or SP.Web.ensureUser to make sure the entry is available.

Michaël Hompus
  • 3,349
  • 24
  • 35