07-01-2014 07:08 PM
Is there a way to find the last modified time of the document? I need to search all the documents for which the keywords are updated either by reindex or by the workflow.
07-01-2014 08:20 PM
Atit,
I might have a solution, but I need to ask a few questions first:
07-01-2014 08:22 PM
Oh, Also... Do you have the OnBase Reporting module?
07-02-2014 10:11 AM
Atit,
Thanks for your question! You can access the document history using the DocumentHistory and DocumentHistoryItem classes. If you are looking to get the last time a document was modified by a keyword change, you can do the following:
Get the document history of the document in question, iterate through the DocumentHistoryItems and look for an action that contains 'Keyword' using a regular expression (**Note** you want to look for 'keyword', not 'keywords'. If you look for 'keywords' you will get results like "Viewed Keywords" which you dont want), and then get the LogDate of that DocumentHistoryItem. When you retrieve the DocumentHistory for a document, the most recent item is the first returned, so i did a quick counter to only get the first item that matches 'keyword'.
**EDIT** When a document is re-indexed, and the document type changes, it will log "Document Re-Indexed" so you could use the regex to evaluate for this as well.
This is what my test looks like:
Document doc = u_app.Core.GetDocumentByID(1234); DocumentHistory docHistory = doc.GetHistory();int i = 0; foreach (DocumentHistoryItem docHisItem in docHistory){ while (i < 1) { if (Regex.IsMatch(docHisItem.Action, @"\bKeyword\b")) { //Do Work i++; } }}
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.