Overwrite the Created field for a Sharepoint list item

Sharepoint provides automatic fields, like “Created” that contains the creation date of a list item. It’s a readonly field.

You could use a webservice to change the ReadOnly property in order to overwrite its value.

Using SharepointPlus the code is:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// don't change the below information
// the details about this field are found using $SP().list().info
var updateSystemFields = "<fields>" +
    '<method id="1">' +
    '<field id="{8c06beca-0777-48f7-91c7-6da68bc07b69}" name="Created" sourceid="http://schemas.microsoft.com/sharepoint/v3" staticname="Created" group="_Hidden" colname="tp_Created" rowordinal="0" readonly="FALSE" type="DateTime" displayname="Created" storagetz="TRUE">' +
    "</field></method>" +
    "</fields>";
// send the request to the server
$SP().webService({
  service: "Lists",
  operation:"UpdateList",
  properties:{
    listName: "Name of the list",
    listProperties: "",
    updateFields: updateSystemFields,
    newFields: "",
    deleteFields: "",
    listVersion: "",
  }
})

Leave a Reply

Your email address will not be published. Required fields are marked *

*