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

Eventhandler, when an object-file is updated with another file (UIX)

Hello,

I've got an UIX application, which runs when an object is created. It checks a file and returns a message, if the file is not allowed to be saved in M-Files.

Now I wan't to imolement the same feature, when a file is updated via Drag&Drop. But I cannot find the correct Eventhandler in the VaultEntry object.

Does anybody know, which eventhandler is the correct one for this?

Greetings from germany

Michael

Parents
  • I don't know if there is an event handler that triggers when you drag and drop the file into M-Files, but there are event handlers that trigger before the object gets created. For example, "BeforeCheckInChangesFinalize" and "BeforeCreateNewObjectFinalize" triggers as soon as the user clicks the "save" button and before the object actually gets added to the vault. If you find an issue and throw an "MFScriptCancel" error message then it should prevent the user from actually saving the object to M-Files, and force them to click cancel. 

    The following M-Files page might be helpful, it shows a table of the event handlers, when they trigger, and what variables are available for use:

    https://www.m-files.com/user-guide/2018/eng/Event_handlers_variables.html 

  • But these are Eventhandlers from the Vault Application Framework. I am working with the UI Extensibility Framework. In the context of VaultEntry I can use the following events: https://www.m-files.com/UI_Extensibility_Framework/#Events.html

    The CheckIn-Events do not provide the path to the file in the file system. Or is there any member which tells me the original path and filename? Do I have to read these data with MFBuiltInPropertyDefOriginalPath, MFBuiltInPropertyDefOriginalPath2 and MFBuiltInPropertyDefOriginalPath3?

  • Hi Michael,

    although I work with VAF, not with UI Extensibility Framework here is an idea that I got from reading UI Extensibility Framework documentation.

    From the link you have provided I found an OnCreateObject Event that might be able to solve your solution. You could use it to get to sourceObjectFiles which is out parameter of that event. sourceObjectFiles contain a collection of SourceObjectFile which have SourceFilePath property which is an absolute path to the source file.

    Hope this helps!

  • OnCreateObject is the eventhandler I already use for checking NEW files. My problem is that this eventhandler does not fire when i update an existing object. 

    Perhaps Craig Hawker could help. How can I  mark him here, so that he will got a notification?

  • Unfortunately I do not have a specific answer for you.

    My suggestion would be to write a UIX application that reacts to all documented events and logs a message somewhere indicating the event that fired.  Then drag and drop a file in as you want and see what events are logged.

    From this you will be able to see whether there is a suitable event or not.

Reply
  • Unfortunately I do not have a specific answer for you.

    My suggestion would be to write a UIX application that reacts to all documented events and logs a message somewhere indicating the event that fired.  Then drag and drop a file in as you want and see what events are logged.

    From this you will be able to see whether there is a suitable event or not.

Children
  • I have tried several events. Just OnCheckInObject fired at the desired action. But I did not get any File-Information to the dropped file. I need the original file path. In the VAF I make a query for MFBuiltInPropertyDefOriginalPath, MFBuiltInPropertyDefOriginalPath2 and MFBuiltInPropertyDefOriginalPath3. But this didn't work here.

    Is there any other possibility to get the original file path?