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

Version Control Lite - Ask user to create new version when drag and drop document

Hi Craig,

I am looking at possibly extending the functionality in the Version Control Lite module of the Compliance Kit by building a VAF/UIX application. I am specifically looking to somehow prompt the user if they want to “Create a New Version” if that user attempts to drag and drop a file onto a controlled document in the released/published workflow state. We are trying to avoid the need for the user to create a new version of the document first before dragging and dropping a file onto the document. If this is something that is feasible in your mind, I would appreciate a quick overview of how I would build that so I am not spinning my wheels for too long. 

thanks,

Jack Dawson

Parents
  • Hi Craig,

    Is there an event that would allow me to fire off code in a VAF when a file is dragged onto an existing document?

    Thanks,

    Jack

  • From a server perspective, the server/VAF don't understand that a document was dragged onto an existing document.  The events that are raised simply indicate that the object was updated.  That update could have come from an API call, the object being checked out/in, etc.

    I don't think that an explicit event is fired for this in the UIX either; the only hits related to dragging/dropping in the documentation refer to events inside dashboards, not in listings.

  • What if I were to trigger my code from a BeforeFileUpload event? I was thinking that my code could validate some properties to confirm that the document is a "controlled document" and then send a prompt to the user asking if they want to "create a new version" to which the user can say yes or no. If they say yes, then it would move the document to a new workflow state and then complete the file upload. Does this sound like a workable solution?

  • I don't think that's possible, for a couple of reasons.

    Firstly: based on this documentation: https://userguide.m-files.com/user-guide/latest/eng/Event_handlers_variables.html.  Note that in the available variables it does not include anything about the object that the file is being uploaded to, so I am not sure that you'll actually be able to check whether it's a controlled document or not.

    Secondly: even if it were, there's no way to prompt the user to confirm something at this point.  You can throw an exception (which should stop everything), but there's no way for them to confirm that this is something they want to do.

Reply Children
No Data