Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Sharepoint Online via CSOM updating DATETIME fields?

$
0
0

Hi guys,

  In sharepoint online I'm having trouble updating "dates" in "datetime" fields.  I'm talking to sharepoint using CSOM, and here's an example that's not working:

  item.FieldValues["datetimefield"] = DateTime.UtcNow;
  item.Update();
  userContext.ExecuteQuery();

  Before the execute query method is called it appears to have the new date and time stored, but afterwards, the date and time is set back to the original time that was there before.

  I've also tried setting it as a string eg:  (which also doesn't work.)
  item.FieldValues["datetimefield"] = "2015-05-7T03:00:00Z";

  Anyone have any ideas or resources?

I have no problems updating any other fields except datetime fields.


Viewing all articles
Browse latest Browse all 7589

Trending Articles



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