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

Saving metadata without checking-out document

Hi. 

I would like to ask a question. When I change document metadata with a workflow state, they are not displayed in the document until it´s checked-out. Is there any way how to automate this thing with the script? I am not sure if I read well that this can be done only with VAF? 

Thank you very much for your help. 

Parents
  • There is a configuration option to enable template metadata updates during check-in, this is disabled by default as it may have a negative performance impact in some environments. Instructions for enabling in the user guide: https://www.m-files.com/user-guide/latest/eng/enabling_metadata_field_updates_in_web_and_mobile.html Not sure if this helps in your case but you could try it and see if it would save you the trouble of scripting.

    If you end up needing a scripted solution, you can call the UpdateMetadataInFile method in the API to update the embedded metadata.

  • Hi Joonas and Lola, 

    I have wrote about this problem one year ago: https://community.m-files.com/forums-1552881334/f/m-files-server-configuration/4623/ms-word-templates-behavior. In that moment of time, the feature you recommend behaved very strange and did not really work well.

    I have re-tested again and unfortunately for us it still does not work as expected. We have now behavior that on word documents placeholders are getting applied immediately (actually expected) after save and without checkout. This is great but when final document is created as PDF using workflow state option "Convert to PDF / Store each PDF as a separate file", it created PDF without last approval date of user who moved document to last workflow state. We calculate date and time in pre-condition of the state so it is definitely provided when on workflow state M-Files tries to create PDF. Word document contains all approval dates but now our final PDF documents (actually more important for end users) do not have the date of last approver. So it seems we have reverted our problem, now PDF is not containing all dates but Word has it; before it was other way around.

    It is quite deterministic and problem goes away if I set a feature on "No" and remove "docx" from extensions (if I keep "docx" in extensions but set feature on "No" problem still occurs which is really strange).

    It would be really good if someone from M-Files can reproduce it and create a bug. This is such a crucial feature and it would be great it is finally fixed and works correctly. 

    I revert it back as for us are final PDF documents more important as working copies.

    Thanks.

    Dejan

  • Hi All, 

    thank you very much for all your help. 

    I guess that I could live at least with the possbility to have all data in Word document before converting it to pdf, but when I add the extension in advanced vault settings it doesn´t work. I am just wondering when you´re mentioning that you set the feature on "No". Where can I do that? Haven´t found anything like that in manual Jonaas mentioned above. Just want to be sure if I am not missing anything here? 

    Thanks. 

  • Hi Lola, 

    This is how I configured it:

    Let us know how it works for you. Perhaps if you have at the end of your workflow PDF creation.

    Thanks 

    Dejan

  • Thank you Dejan. I don´t have that possibility in M-Files. Maybe it´s because of an older version? Don´t know. I will consult it with our provider.

    Again, thank you so much for your help! 

  • It works! Thank you so much! Slight smile Just didn't know, that I have to click on File Operations not the Extension Filter for Embedded Metadata Update on Check-in option to display the feature. Great! 

  • Does it also work for you when creating pdf at the last workflow step? Could you test that one?

    Thanks

  • I tested it and all fields I filled  in before creating the pdf file are displayed. 

  • Also in PDF file, all data are filled? That is awesome. Strange but it does not work for us.

  • yes, but we have only some data displayed in the file not all of them, so I can´t say if there could be something missing. I tried to fill in everything possible and it works fine. Slight smile

Reply Children
No Data