A Developers Blog

Tag Archives: Fields

Lets say that you do not want to allow users to possibility to edit and insert values to a custom field in one of your lists. To do this you can set the values of one of the following properties of a SPField object:

ShowInEditForm

ShowInDisplayForm

ShowInNewForm

You can do this programmatically at any time, below is a link on how to do it:

The problem is very simple in this case. The modified field does not work anymore. When a document or any list item is modified the time stamp does not get updated as it should.

To fix this problem you need to do two things unfortunately.

First you need to update the out of the box Modified field. You can do this by a manually modified URL to the edit page of fields. You have to do this because the field is visible by default. Below is a sample URL:

Pay attention to the bold part of the URL.Just past the bold part after your application domain name and you will be fine. Next all you need is to simply press the “OK” button and be sure to leave everything else unchanged. Especially the update option must be set to yes. What this will do is simply go through every “Modified” field use in your SharePoint application and makes some updates to the field. This will fix the time stamp problem.

2. After you do the seconds step you will run into another problem that an xml attribute from the Modified field schema is missing. This needs to be fixed by a script. Below you will find the code that fixes this error AND also does the update procedure in step 1 described above. So no manual labor here :).