You are viewing limited content. For full access, please sign in.

Question

Question

Can we use SDK to actively extract document's creation date and modification date from any type of file?

SDK
asked on October 13, 2015

Hi

 

Our client has 2 million documents to import and they will also use Laserfiche to save, Import, drag in files and email attachments etc..

 

I was able to use Quick Field to extract the Creation and Modification date and insert it into document fields. And as per documents that needed to be brought in by dragging, saving, and importing I was able to assign fields using tokens to get files' original creation and modification date. 

 

Now Modification date field has static value and will not change as future changes happen to the document and this create discrepancy for client users.   I like to automate this process by some type of workflow activity to extract creation date and modification date when the document gets saved into Laserfiche and is updated subsequently.   I checked workflow, I could not see a way to do this.  The client want to have one point of reference to get accurate creation date and modification date information.

 

I am wondering if it is possible through use of SDK workflow to achieve the following:

1.   get creation Date and modification date from document property on file creation or file change (from Property of document that we access from windows or when we open the file).

2.  Ideally insert these values into property of document in Laserfiche property  (property of the file within Laserfiche which has its own creation and modification date)   -   If not insert into the fields

3.  If the answer was yes to 1 and2 would it apply to all types of files, such as office, acrobat, images, etc?

 

 

Thanks

 

0 0

Answer

SELECTED ANSWER
replied on October 15, 2015

 

So, SDK is able to get the values from the properties of the document,  on Question 2 I understood that  its not possible to overwrite the doc property in LF but can we use the values extracted from property of the Doc and insert them into Doc template fields?  This also can work.

0 0

Replies

replied on October 14, 2015

I understand saving the original creation date in a field since that would be outside of Laserfiche's control. But why save the last modified date in a field? Laserfiche already keeps track of that and offers a column in the Laserfiche Client and Web Access for displaying it. The last time the electronic document was modified is also tracked separately from the document's last modified date and available as a column. What would a field offer extra? Not to mention that setting the field would also count as a modification to the document, so you would trigger another update to the document and so on.

 

0 0
replied on October 14, 2015

Hi Miruna

If we create a new document things work fine. Client wants the creation and modification date of the existing document brought in and recorded in fields.  This ways the client would have line of sight  in LF columns to see the original creation and modification date (before opening he file).    On next change we depend on Laserfiche modification date to track it.     With this set up I have to have three columns: 1.  original creation date, 2. original modification date, 3. LF modification date which client thinks will confuse the users.    Client likes to see Original creation date and consolidated modification date starting with original modification date.   Meaning modification date start with the modification value from file imported and change as file changes or updates in LF.     This would be possible if we could extract(?) the values from document and insert them into the field  on each document update?

 

 

0 0
replied on October 14, 2015

Right, but inserting values into the field is a modification of the document. So that would trigger another update. Which would also be a modification. So you would be in an infinite loop of updating that field.

Since the modification date from the file is only relevant until the document is modified through LF, I would add it to the field on import. Then, the first time the document is modified in LF, I would wipe out the field and let the "Last Modified" column in LF take care of it going forward. That way, users would have an eacy indicator if the document was ever modified since imported into LF or not.
 

0 0
replied on October 14, 2015

Couldn't we use condition in workflow to not to act on changes done by workflow user to stop looping and just act when modification done by users?

 

The have large amount of documents that are moving in from windows and also have consent flow of electronic documents that come in from outside sources.  How can we takeaway the captured modification field away? It has to be on doc by doc bases. 
 

0 0
replied on October 14, 2015

You can exclude the Workflow user. But that would still be a lot of workflow activity generating unnecessary load on the server trying to replicate existing Laserfiche functionality.

Emptying out the field value when the document is modified can be done with a workflow that checks if the field is not blank on entry changes. The load would be a lot less since you would only be checking if start conditions are satisfied (and they wouldn't be in most cases). You could even disable this workflow later as you determine that all documents has been modified in LF.

0 0
replied on October 15, 2015

Your suggestion on starting rule is well taken but I still need to know if workflow itself can be driven by workflow or SDK to solve the issues mentioned.   I need to go back to our sales with answers to three questions mentioned intialy, see below?  

 

"I am wondering if it is possible through use of SDK workflow to achieve the following:

1.   get creation Date and modification date from document property on file creation or file change (from Property of document that we access from windows or when we open the file)?

2.  Ideally insert these values into property of document in Laserfiche property  (property of the file within Laserfiche which has its own creation and modification date)   -   If not insert into the fields?

3.  If the answer was yes to 1 and2 would it apply to all types of files, such as office, acrobat, images, etc?"

 

Thanks

0 0
replied on October 15, 2015

1. You can use Find Entry on the starting entry to read its last modified property or a SDK script

2. No, you cannot override the last modified date with your own custom value. The value is only set by the LF Server when documents are modified. Allowing arbitrary modifications through the SDK would render this property useless.

3. Last Modified applies to all types of documents.

0 0
SELECTED ANSWER
replied on October 15, 2015

 

So, SDK is able to get the values from the properties of the document,  on Question 2 I understood that  its not possible to overwrite the doc property in LF but can we use the values extracted from property of the Doc and insert them into Doc template fields?  This also can work.

0 0
replied on October 15, 2015

Yes.

0 0
replied on October 15, 2015

Thank you very much for you help.
 

0 0
replied on October 14, 2015

You can get the original modification date of a file through the windows API. For example: https://msdn.microsoft.com/en-us/library/windows/desktop/ms724320(v=vs.85).aspx. Once you've got the value, there's nothing special about adding it to a template field. 

0 0
replied on October 14, 2015

Just going back to my original question.  The idea from customer point is to only see one column, information reflecting the modification changes.   Rather than having Original modification date and LF modification date.   They like to see one column which will start with document's original modification date and than updates with the on going modification date done within Laserfiche.     In this case the idea was (I was hopping for)  the SDK to watch the folder and on creation and change of doc to grab the new values from within the word document and insert it into the Field.   I am not even sure if SDK can read these information from save document. (and that would be any type of document and not only MS)

 

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.