4

I know SharePoint has some hidden fields for list items. I need to check the timestamp for when a list element was created, is this possible?

The reason is I must allow the item to be edited for the first 10 minutes after creation, but not after that (through an item receiver).

Thanks in advance

3 Answers 3

6

The other answers work, but you may want to consider:

item[SPBuiltInFieldId.Created];

I'm never sure what happens to the default field names in non-English language setups.

1
  • 1
    The CSOM ListItem object doesn't support Guid indexor. Must use the ["Created"] instead. Commented Nov 19, 2013 at 15:28
7

Each item has a created date and modified date which you can get through the indexer.

item["Created"];
5

The item["Created"] field will store the date and time that item was created. Cast it to a DateTime type to do your comparison.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.