ahp_freehostSHPThe problem is once you produce a link to a document inside a document set in SharePoint 2013. If you’re not familiar with this – customers can produce links inside document libraries, using a content sort known as “Link To Document”. You are able to also develop document sets – which can be a unique type of folder. To accomplish so, add the two content kinds to a document library:

16

You then also must configure the document set content material kind to accept links to documents within the document set settings beneath the content material kind settings:

17

The problem is whenever you produce a document set, and in it you then create a hyperlink to document:

18

The outcome is the fact that the users get redirected towards the incorrect URL, and as opposed to seeing the actual document set they started from, with all the new link (or any document which is currently inside the document set) the customers see a default view of a generic document set – not the 1 they began from:

19

The reason for this can be distinct in 2010 and 2013. I have yet to pinpoint the cause for the concern in 2013, but in 2010 the issue is that the URL when producing a brand new link to document has two “RootFolder” parameters, and that confuses the server when the customers click “OK” to save the hyperlink and to acquire redirected back. Rather than seeing the document set, they see the default document set residence page – with no parameter to inform the server which document set to truly display the contents of.

I’ve developed a workaround for 2010, and am however to modify it for 2013 (since the behaviour in 2013 is slightly distinct, although the outcomes will be the exact same). The workaround would be to use javascript to detect if we got for the current page from the edit form, and when the present page is a document set home web page and if the present web page parameters have two query marks in them. If that’s the case, redirect the user, removing the second “&RootFolder=” parameter. This will not work in 2013 given that the url there doesnt have parameters after making the link to document.

Here is an example of the code. To inject it I used a farm level feature that added a ScriptLink to all pages in the farm. The script link was to a .js file that contained the following code :