I am trying to retrieve "Modified Date" and "Created Date" for folders when using GetFolderByServerRelativeUrl function, how can i do it?
I only able to get relativeUrl and folder Name out of it. below is what i did to retrieve the folder. Please help.
FolderCollection folderCollection = rootweb.GetFolderByServerRelativeUrl("/Shared Documents/test2").Folders;
spClientContext.Load(folderCollection);
foreach (Folder folder in folderCollection)
{
}
I don’t think there is any direct way to get the folder's modified data. But you can get the folder related item first, and then get the item’s modified data.
But you still cannot get the folder related item using JavaScript Object Model. You can try to get the items which content type is folder by caml query, then fetch the item whose related file's server relative url is equal to the folder's server relative url, then you can get the detailed information from the item.
By retrieving and accessing the
ListItemAllFields
property of yourFolder
s, you can access the created and modified dates as follows: