1

I am using the default new list form for adding and editing the item. Now i have a requirement where i need to get the last modified date/time of a particular column(Not item) based on which the timer job will run. So is there a way where we can get the last modified date/time for a particular column or can store date time in additional column ?

1

You did not specify how you want to achieve it (get it only onetime or display it in the display form...).

First you should enable versioning. Then you can create some function (server side code, PowerShell) that will iterate all versions and find first version that contains some value in your column. The version you just found contains Created property that you can use.

Example in PowerShell:

asnp *sharepoint*
$web = Get-SPWeb http://server/sites/site
$list = $web.Lists["Some list"]
$item = $list.GetItemById(1)
$sortedVersions = $item.Versions | Sort-Object VersionId

foreach ($version in $sortedVersions)
{
    $value = $version["Your column"]
    if ($value -ne $null -or $value -ne "")
    {
        Write-Host $version.Created
        break
    }
}
$web.Dispose()
0

What do you mean by last modified date for column? if you modify a item(ex. a single column) then also the modified date column will be updated. You can get the last modified date/time by Modified column which is there for each list item and this column get created by default when you create a list.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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