This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Updating Created, Created By, Last modified and Last modified By properties

Hello,

I need to copy objects from one vault to another and need to maintain values of the following system properties: Created, Created By, Last modified and Last modified By.

Meed to make sure that all history is preserved.

I know that it may not be very straightforward since the system will try to overwrite the values during object creation / check-in in new vault, so it may be needed to "trick" the system somehow. 

I have done similar tasks in FileNet and it wasn't trivial but at that time I was able to find sample code on IBM site that showed how to do it. 

 

Does anybody know if it is possible to do in M-Files?  I have seen another thread with similar questions but they were not answered.

Any help would be appreciated.

Thanks in advance!

Parents
  • Sounds like a simple task using the Replication feature. It will do exactly what you need if you have the same structure elements in both vaults - at least the object type, class and properties used for the objects that need copying. Make sure you have the exact same aliases on all of those structure elements in both vaults - their IDs are probably different.

  • Thank you for your response!

    It would be great if I could use replication in my case.

    Just to clarify the requirements:

    I need to be able to archive selected objects (of the same type) from the source to archive vault, after the copy/archival they will need to be deleted from the source vault

    Objects to be copied have many properties including the ones with data type "Choose from the list" where list is either a fixed Value List or another object type:
    - When property values are selected from a pre-defined value list or fixed number of objects for some type, then those underlying objects will exist on the target vault, and they will not need to be deleted along with the main object
    - There are also 2 multi-document types for which the main object type is a parent, they will both contain 15-20 files in them, they will need to be deleted on the source vault along with the main object after archival is completed

    All object types, classes, property definitions, value lists etc. have aliases that match in both vaults however specific id's could be different.

    I need to copy all versions of the main as well as children objects and properties that point to items from the list will need to point to corresponding values on the target vault.

    I have used simple export / import using pre-defined filters available from M-Files Admin screens, however in my case filtering of the object from the main type will have to be based on the list of unique identifiers (file numbers) defined for that class.

    Such filtering is probably possible but some manipulation of export/import xml files may be needed.


    If based on my description, Replication feature can be used, I would appreciate if you could point me to any samples / manuals where it is described.


    So far I have written the code that copies the whole structure based on the list of unique id's (and deletes on the source vault). It seems to be working for all versions and properties excepts for the ones I mentioned above in this post: Created, Created By, Last modified and Last modified By. For those property definitions I get inconsistent behavior.


    Thanks!

Reply
  • Thank you for your response!

    It would be great if I could use replication in my case.

    Just to clarify the requirements:

    I need to be able to archive selected objects (of the same type) from the source to archive vault, after the copy/archival they will need to be deleted from the source vault

    Objects to be copied have many properties including the ones with data type "Choose from the list" where list is either a fixed Value List or another object type:
    - When property values are selected from a pre-defined value list or fixed number of objects for some type, then those underlying objects will exist on the target vault, and they will not need to be deleted along with the main object
    - There are also 2 multi-document types for which the main object type is a parent, they will both contain 15-20 files in them, they will need to be deleted on the source vault along with the main object after archival is completed

    All object types, classes, property definitions, value lists etc. have aliases that match in both vaults however specific id's could be different.

    I need to copy all versions of the main as well as children objects and properties that point to items from the list will need to point to corresponding values on the target vault.

    I have used simple export / import using pre-defined filters available from M-Files Admin screens, however in my case filtering of the object from the main type will have to be based on the list of unique identifiers (file numbers) defined for that class.

    Such filtering is probably possible but some manipulation of export/import xml files may be needed.


    If based on my description, Replication feature can be used, I would appreciate if you could point me to any samples / manuals where it is described.


    So far I have written the code that copies the whole structure based on the list of unique id's (and deletes on the source vault). It seems to be working for all versions and properties excepts for the ones I mentioned above in this post: Created, Created By, Last modified and Last modified By. For those property definitions I get inconsistent behavior.


    Thanks!

Children
No Data