cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Unpublish the current major version of a document

Jump to solution

How can I unpublish the current major version of the document as a part of a "suspend" workflow to ensure that regular users can't see it anymore?

0 Kudos
Reply
4 Replies
Workflow Hero

Re: Unpublish the current major version of a document

Jump to solution

If you publish the second to last major version of the document, the last version won't be published anymore and only users who are allowed to access history versions of the document will be able to see it.

Hope this helps

0 Kudos
Reply
Highlighted
Not applicable

Re: Unpublish the current major version of a document

Jump to solution

Hi Caroline,

Thanks for your reply. What I wanted to achieve is that the document in general is not available to any user anymore. That's the reason why my workflow is creating a new draft version (which exclusively can be accessed by user hving the appropriate rights to see drafts) and set's it to "suspended". But then I somehow need to find a way to "unpublish" the last approved version (similar to that what I can do from within the document history). This means my workflow somehow needs to find the "current major version" (in the version list), select and unpublish it.

Means I don't want to have any published version anymore.

0 Kudos
Reply
Workflow Hero

Re: Unpublish the current major version of a document

Jump to solution

ok, if you're using SharePoint 2013, you can call a REST API request to do it.

I've written a blog on that : How to execute a REST API request with Nintex Workflow

To unpublish a document, you can call the following POST REST API request (Files and folders REST API reference ) - don't forget to get the request digest and add it as an header of the following request :

http://your_sharepoint_site_url/_api/web/getfilebyserverrelativeurl('/your_site/your_Library/your_filename.docx')/unpublish(comment='Check-in comment for the unpublish operation.')

Hope this helps

0 Kudos
Reply
Not applicable

Re: Unpublish the current major version of a document

Jump to solution

Great, thanks for your support. I will try this.

0 Kudos
Reply