Tag Info

Hot answers tagged

4

Example 1 Explicitly specify choice value: using (var ctx = new ClientContext(webUri)) { var list = ctx.Web.Lists.GetByTitle("Tasks"); var taskItem = list.GetItemById(itemId); taskItem["Status"] = "In Progress"; taskItem.Update(); ctx.ExecuteQuery(); } Example 2 Choose a value from field choice: using (var ctx = new ...


4

You Can set it by updating the Item with the choice value, as below newListItem["ChoiceFieldName"] = "ChoiceValue"; newListItem.Update(); clientContext.Load(newListItem); clientContext.ExecuteQuery(); But if you are assigning a Value which is not in the Choice Column, You need to create a choice value then assign it to the item.


4

I normally follow as below SP.SOD.executeFunc('sp.js', 'SP.ClientContext', readyFunction); function readyFunction() { getCurrUser(); evalGroups(); getDeptMgrs(); getItemOwner(); } Its more readable!


3

I'm assuming you're on a standard SharePoint page -- if so, you can use the _spPageContextInfo object's userId and userLoginName properties. They come along for the ride when the page is rendered. From my browser dev tools: >_spPageContextInfo.userId 1337 >_spPageContextInfo.userLoginName "somebody@somecompany.onmicrosoft.com" If you're dealing ...


3

In this approach it is determined whether User belongs to specific Group and if so, then he/she is getting redirected to another page: function isUserMemberOfGroup(userId, groupId, success,error) { var ctx = SP.ClientContext.get_current(); var allGroups = ctx.get_web().get_siteGroups(); var group = allGroups.getById(groupId); ...


1

SP Foundation does not include the User Profile Service, as @Aveenav noted. Therefore you probably do not have access to the REST endpoints for that service. Instead you will have to use the user information list to get this information. This will require two requets: one to get the current user's id, the second to get the user's info that you want. ...


1

The DisplayName property is A string that contains the item display name, which for a document library item equals what the user types in the Name box of the item form. The default value equals the original name of the uploaded file minus the file type extension. as stated here. If you would like to order the items in a document library you can ...


1

You've got a plenty of answer how to check permissions. If you want to check the group membership (it is of course not the same as permissions), then you have to check which groups the current user is member of and decide where to redirect. Alternative 1 I have written a little example how to achieve this using jsom. Suppose you have a group called ...



Only top voted, non community-wiki answers of a minimum length are eligible