Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a SharePoint site collection with both the Document Set and Document Id features enabled. I then have a document library where I've created multiple document sets, each with one or more documents. Lastly, I have a page that displays a flattened list of all the documents.

Is it possible to get the Document ID (aka Parent Id) of the document (child) in this view? I want create a link back to the Document Set Welcome Page for the parent document set rather than the default link directly to the document. Can I somehow create a look up column in the view that would pull back the parent Document ID?

Document ID's seem like the best way to make this happen but I'm open to other suggestions.

share|improve this question
add comment

2 Answers

Document Sets basically are a specialized version of a standard folder.

You should be able to reference the container document set by first getting the reference to the container folder (doc sets doesn't support sub-folders, so the first parent folder for the file should be the document set) and then using the static DocumentSet.GetDocumentSet Method to obtain the document set instance.

Es:

SPFolder docSetFolder = targetSPFile.ParentFolder;
DocumentSet docSet = DocumentSet.GetDocumentSet(docSetFolder);

Could this work for you or there was any special need for using the document id?

share|improve this answer
    
No special need for the document id. The goal is just to be able to link to the document set welcome page. –  Greg Enslow Jul 27 '12 at 16:08
add comment

I was able to do this by using a workflow that copies the Doc ID to a text column if the content type is a doc set, then adds it to a variable, then copies to yet another column. From there, I share that column in the doc set settings so that any documents added to a doc set get the value (the doc ID from the document set).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.