Adding a document to a SharePoint list using a Ribbon button

terahex Source

I have a SharePoint solution using a custom document library. I need a way to allow users to added documents, but I need to specify the file name based on strict naming conventions. I am currently trying to use a Sharepoint workflow, but there is some contention for document control. I was thinking I could write a ribbon button that would added the document, and immediately name it. It looks like ribbon buttons calls javascript, but I not sure how to create a new document using a Javascript function. Any suggestions or alternatives?



answered 6 years ago Mihai Brustur #1

You don't need to create a document using javascript, you just need to write a custom action [RibbonButton] that calls a method in some assembly that adds a new document to the desired document library following your rules. And if you can only add documents using a specific set of rules, make sure you disable the out of the box "Add Item" button on that custom document library.

You should check this link out:

Hope it helps.

comments powered by Disqus