According to this article, the only way to create a Document Set version is to do it manually by clicking on "Capture Version".
I know that's not entirely true because DocumentSet.VersionCollection.Add()
is available in C#.
I do have event receivers in my solution but I'm not always in that part of the process when I need to capture a version of the Document Set.
Poking around in a browser I found DocSet.Ribbon.DocSetCommands.createVersion()
when on a Doc Set home page, but that just launches a dialog for the user to enter the version comments.
I suppose I could do some quick DOM manipulation to enter my own comments and "click" the dialog's OK button to submit the form and trigger the version capture, but I also might need to trigger a version capture when I'm not on a Doc Set home page. And even if I was on the home page, having some dialogs flash up and then disappear for no apparent reason is not great UX.
Is there any other way to trigger a Doc Set version capture from JavaScript?
This is specifically for SP 2016.