11

If you are updating a list item more than once in succession, after the first update the list item (oListItem in your case) object will have become stale, and the server will reject the update. SharePoint uses a hidden field called owshiddenversion, which gets downloaded along with your CSOM object, to determine which version you are editing. When you send ...


11

I have a list called rohit_list1 on which i am updating title for all the items with ID greater than 15. You Write your own CAML query to get ID's. Design : <input type="button" value="updateMultipleListItems" onclick="getItemsToBeUpdated()" /> JSOM Code : <script type="text/javascript"> var collListItemToBeUpdated = ""; var ...


6

Try the following script: $web = Get-SPWeb http://YourServer/ListLocation $list = $web.Lists["TheList"] foreach ($item in $list.Items) { if( $list.Fields.ContainsField("ddlTest") -eq $true) { $item["Number"] = Get-Random -Min 0 -Max 100; $item.Update(); } }


6

If you only use this for display purposes, why not use a different approach which does not require you to do updates on the list item at all.... Create the site column in a sandboxed solution. Your column stores the Due date. Create a javascript file to deploy somewhere to your site, e.g. /Documents/duedate.js Configure the JSLink property in the site ...


6

Yes event receiver do get fired if item is updated from client object model code. This is how I tested it. Created a custom list and added a text column named "Quantity" to it. Then created a SharePoint project containing an event receiver "ItemAdded". This event is added to custom lists only. Then added code to update the title of the item. public override ...


6

Please find the code to update Created, Created By, Modified, Modified By using CSOM. ClientContext ctx = new ClientContext("http://siteURL/"); List list = ctx.Web.Lists.GetByTitle("Info Path"); ListItemCollection items = list.GetItems(CamlQuery.CreateAllItemsQuery()); ctx.Load(items); // loading all the ...


5

OK, SO I think I solved my problem. I actually had two things going on here: 1) A WCF connection propagates metadata updates on check-in to another web application (ASP.NET). The field I was constantly getting messages about IS required on that site. Wouldn't expect anyone on here to figure that out. I made the field required in SharePoint and set ...


5

My scenario is update a field in another list. You can leave the variable and change others by your fields:


5

You can pass the display name of your SharePoint List in REST API call like below: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/GetByTitle('abc list')/items" Also make sure you are passing correct ListItemEntityTypeFullName in type property inside __metadata. You can check ListItemEntityTypeFullName of your list using below URL: /_api/web/lists/...


4

Change NULL to null. I tried the following - first test resulted in a 400 Bad Request error, the second one worked fine. {'__metadata': { 'type': 'SP.Data.TasksListItem' },'StartDate': NULL} {'__metadata': { 'type': 'SP.Data.TasksListItem' },'StartDate': null}


4

Since you haven't told us which API you prefer, below is demonstrated how to retrieve and update list items using JSOM API: function getListItems(listTitle) { var deferred = $.Deferred(); var ctx = SP.ClientContext.get_current(); var list = ctx.get_web().get_lists().getByTitle(listTitle); var items = list.getItems(SP.CamlQuery....


4

Explanation Based on your affirmative response to my comment, I've gone ahead and wrote this using the JSOM API. The script works by disabling the ReadOnly property on the RichMessage field, updating the values on your target item, and re-enabling the ReadOnly field. Up until now, this is the only working strategy I've found to change read-only fields from ...


4

Happily, this is straightforward to achieve. What you need to do is insert a section 'If' action immediately after the first, ensuring the 'and/or' toggle is set correctly at the second (and subsequent) 'If' statements. You should end up with something that looks like the following screenshot Where the Column A value is in a separate list you will need to ...


4

As far as I know, it's impossible to validate only if particular field changes. It's by default that column validation would validate the data in this column when items are saved to this list. I could achieve your first requirements using this formula: =IF(ISBLANK([Date]),TRUE,[Date]>=TODAY())


3

What is happening is that your event receiver is kicking in before your PowerShell is done, and modifying it on a different thread before your PowerShell update occurs. When SharePoint hits your update statement, it sees that the item in the database is no longer the same as the one it's trying to update. I've got 3 different approaches: Set all of your ...


3

This turned out to be unrelated to the XML or privileges. The URL I used to hit lists.asmx on the production site was pointing to the root of the site instead of to the web where my list is. So I was using http://mysite/_vti_bin/lists.asmx when I should have used http://mysite/web1/web2/_vti_bin/lists.asmx


3

Event receivers are generally attached to lists by means of a list definition (which can define event receivers that are attached upon deployment) or programmatically through custom code. Depending on how you're deploying this event receiver, you might not actually be attaching the receiver to your list. You can use PowerShell to see which event receivers ...


3

First thing first, Yes you will have to call listItem.Update() reason is because in itemAdded event Item has been added to list already and now you are about to update it. Second, as Paul said you setting item level permissions can be nightmare as they actually effect page's performance while loading it. Third, you might would like to look at this article, ...


3

here is powershell script to list all properties and then how to change them. # Load SharePoint library [system.reflection.assembly]::LoadWithPartialName("Microsoft.Sharepoint") # Connect to the site collection http://SP2010 and store the object in the $site variable $site = New-Object Microsoft.SharePoint.SPSite("http://SP2010") # Connect to the root ...


3

Update this <Value Type='Text'>" + objdocument.Title + "</Value>


3

Since you don't need to use the SPServices library, you can accomplish this via REST and the moveTo() method. The following should work: var url = "/_api/Web/Lists/getByTitle('My List Name')/Items", qs = "?$filter=Attachments eq 1&$select=ID,Author/Title,*&$expand=Author"; $.ajax( { url : siteUrl + url + qs, type : 'GET', headers : { ...


3

Try this clntCntxt.Load(newFile); clntCntxt.ExecuteQuery(); //check out to make sure not to create multiple versions newFile.CheckOut(); ListItem newFileItem = newFile.ListItemAllFields; newFileItem["MyComments"] = "test"; newFileItem.Update(); // use OverwriteCheckIn type to make sure not to create multiple versions newFile.CheckIn(string.Empty, ...


3

In order to modify/update the Author field using the client object model, you need to make sure to Load the Source Item Load the User Object with Source Context Ensure the User Object in the Destination Context Insert the User Object in the Destination Item Update the Destination Item Please find below the pseudo code. sourceCtx.Load(sourceItem); ...


3

You'll need to upload the file using the SP.FileCreationInformation object, you can write to the list item that corresponds to the file by calling <file>.get_listItemAllFields() When you use get_listItemAllFields() you'll have a regular list item object that you can use get_item() and set_item() on. Here is a complete example, you can paste the ...


3

Looks like issue with the internal name, please confirm the column internal name. try with may be "name" columns internal name, this can be default "Title" valuepairs:[["Title",name], ["description", description]]


3

SharePoint REST API does not return the updated item/object after updating it. You are right! It only returns status code 204 if the update request is successful. So to get updated item/object, you have to make another GET request. /_api/web/lists/getbytitle('list name')/items(item id)


3

Please use below code: foreach (AttachmentFile file in data.NewAttachments) { var attInfo = new AttachmentCreationInformation(); attInfo.FileName = "Name"; attInfo.ContentStream = new MemoryStream(theBytes); emailItem.AttachmentFiles.Add(attInfo); } emailItem.Update(); foreach (Attachment a in emailItem.AttachmentFiles) { a.DeleteObject(...


3

Reading through your code, Update call has been used like a property without brackets. It should be a method call as : $i["LinkToOperations"] = $field $i["CustomerURLText"] = "Updated" $i.Update()


3

make the couple of changes as below. Use ExecuteorDelayUntilScriptLoaded to make sure you are executing logic after sp.js file loaded. Your topLists variable make it global as you are using in other function. Make the corrections as shown below jQuery(document).ready(function(){ ExecuteOrDelayUntilScriptLoaded(updatePageViewCount, "sp.js"); }); var ...


3

Running your code yields an error: topicList.getEnumerator() is not possible, as topicList is an SP.List and thus, no function getEnumerator is available. If you incorporate the answer from Venkat Konjeti and additionally modify your topicsList to: topicList = clContext.get_web().get_lists().getByTitle('Topics').getItems(SP.CamlQuery.createAllItemsQuery());...


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