Dear All,
My requirement is to find files which is checkedout from a particular folder and filter the results based on Checked Out Date.
I can get the checked Out files using the FindFilesBySearchConditions where the condition is CheckOutBy Is Not Empty and sucessfully getting the result.
My code below:
Dim filePropDefs AsPropDef() = ServiceManager.PropertyService.GetPropertyDefinitionsByEntityClassId("FILE")
Dim checkedOutPropDef AsPropDef = filePropDefs.[Single](Function(n) n.SysName = "CheckoutUserName")
Dim isCheckedOut AsNewSrchCond() With_
{ _
.PropDefId = checkedOutPropDef.Id, _
.PropTyp =
PropertySearchType.SingleProperty, _
.SrchOper = 5, _
.SrchRule =
SearchRuleType.Must _
}
Dim bookmark AsString = String.Empty
Dim status AsSrchStatus = Nothing
Dim files AsList(OfFile) = ServiceManager.DocumentService.FindFilesBySearchConditions(NewSrchCond() {isCheckedOut}, Nothing, Nothing, True, True, bookmark, status).ToList()
Manually using the FIND in Vault can specify the Look In path and then set the same Condition and ge the checkedout files
How can i point my program to look only in particular directory and get the checkedout files along with checkedoutDate using API?
Am i missing anything?
Solved! Go to Solution.
Solved by Redmond.D. Go to Solution.
The third parameter is an array of folder IDs. If that value is set, then the search will only return files in those folders or sub folders.
If you want to sort by Check Out Date, then you need to pass in sort criteria to the second parameter.
If you want to add another condition, like seeing only files checked out after a certian date, you need to create another search condition and add it to the array for the first parameter.
Hello Doug,
Thank You for your reply...
Will try and get back
Hello Doug,
I didn't know how i missed that, your reply was very much helpful.
But still i am unable to get the CheckedOut Date And Time from result in File()
Am i missing anything...
Checking out a file creates a new version of the file. The File object represent a specific version of a file. So, File.CreateDate is the check out time.
Dear Doug,
I don't think the CreateDate is the checkout date.
Please find the enclosed images
The File Vault.PNG has the checked Out File details extracted manually using the Find
The File File.PNG has the details of the specific file(highlighted) during the runtime from Visual Studio Watch Window
If you compare you can see that the CheckedOut Date received by manually getting the checkout file details does not match the CreateDate extracted from API. There is not Date Value matching in both the files.
This Report is generate during the same time
Am i missing anything, or is there a way to get the checked Out Date from somewhere else
Hi Doug,
I get the previos version created date. Not the current checked out date.
Hmm, the CreateDate behavior must have changed at some point. I won't argue with the Visual Studio debugger, so it looks like there is no way to get checkout date from the File object. You will have to call PropertyService.GetProperties to get the Checked Out value.
Hello Doug,
Thank you for your reply...
I will try and let you know.