Link to another item in a sharepoint document library - sharepoint

I am writing a custom Sharepoint solution and I have to fulfill a requirement that an item in 1 document library must be visiable in another document library, e.g. maintaining global company document which should display in all other librarys
I need to sync properties, e.g. name so that when it changes in the source list it should also change in the destination lists. The items created in the destination list should not be able to have workflows or other options in the ECB Menu (exception for maybe going to source document).
Does anyone have a realistic solution on how to accomplish this ?
I have been trying to use CopyIntoItems of the copy web service to create linked copies with no luck, it always just creates a new copy of the source item (see: http://platinumdogs.wordpress.com/2009/01/14/sharepoint-moss-creating-document-library-items-uploading-files-to-a-document-library/)
Creating a custom content type has also entered my mind (since the source properties is contained in a content type) but then how do I filter the ECB menu ?

If the destination document library is a replica of the source document library, can't you solve this by displaying the items on the destination side using a content query web part instead of duplicating the items?

In the process for googling for something else I might have come across the solution to your problem.
Apparently Sharepoint has a built in 'linked document' type. You can just use that to link the documents, instead of copying.
More info here.

Related

Sharepoint list with attachments in columns

I need to create list of products (with details like date of orders, etc). But I want to also add files for each product, like order document, leaflet, etc and of course I want to have possibility to filer/group by files. I try to create column with files in, but I fail. Maybe I can link somehow documents from Library to items in list?
Can someone help me?
thanks
I got the feeling the best solution to use here would be document sets. It is both for SP onPrem and online
Basically a document set is like and item with metadata and a folder for files at the same time.
Update1
for SharePoint Online (onPrem the steps are very similar, just the look and feel is different)
go to sitcollection features and activate document set feature.
go to content types settings in sitecollection settings and create a new content type
when creating content type make the content type inherit from document set content type
then add some columns (like text fields, datetime pickers etc. whatever is needed, You may also have status column)
after that in the document library You want to use the document set go to list settings and in advanced settings turn on content type management
add the new document set content type (You may also add this ct as default one)
when adding new item select the new content type. You will have the new form with all the defined columns, In the item You may add files like You would add them to the folder. Being in the item You may see the properties in the right property pane
I hope this solution is what You need :). I think it is the best OOTB solution that I can think of for Your problem.
Update2
please also check this link for a similar step by step instructions but with screens.

sharepoint list Vs library-developer point of view

What is the exact differnace between sharepoint list and library in developer point of view?
From a programmer's point of view, a Library is referenced through an SPDocumentLibrary object. SPDocumentLibrary inherits from the SPList class.
A Library is a List, but all lists are not libraries.
A Library is a specific implementation of a List intended for holding documents and metadata about the documents in the columns of the Library.
According this blog, http://www.networkworld.com/community/node/22731, use Library for storing documents, and use Lists for data, for example, a database record. Here's a direct quote
"I dug a little deeper and did find some points about list attachments
that suggest a list is probably not the best way to house documents if
the organization wants to take advantage of the full range of SP
features:
1) The title of the document is NOT indexed. So an end user would not
be able to search on the title of the document. Example: I attached a
document titled "Copy of Test Lobster.doc" but after incremental
indexing I get no results searching on the word "lobster." (medium
issue)
2) I can attach multiple documents to one list item, which could cause
problems (minor issue)
3) You can't (to the best of my knowledge) display the name of the
attached document. You only see the paperclip that signifies the
attachment. (major issue)
4) You don't have document control, no check-in or check-out. (major
issue)"
I would say except the content type their is no difference between list and library the base content type for both differs
for other programming differences kindly go through the following url
http://msdn.microsoft.com/en-us/library/dd490727(v=office.12).aspx
Libraries can hold files so a few additional methods/properties such as Item.File are valid for accessing the files. Anything involving the metadata columns will be much the same.
A document library is a specialized form of a list that has additional features to manage documents. This is also evident in the SDK where you can see that SPDocumentLibrary extends SPList.
Another way to think of the difference is that a document library contains documents while a list contains "contentless" documents (aka only metadata) - although this is slightly violated by means of attachments.
Difference:
List:
Don’t have Check in Check Out feature.
Have Major Versioning only.
We can attach multiple files to a List Item.
“Upload Document”, “Download a Copy” option not available.
Attached document is not searchable by Title.
Cannot display the name of attached file (only See paperclip symbol).
Library:
Have Check in Check Out feature.
Supports Minor (draft) and Major (Published) versioning.
1 Library item cannot have multiple files.
“Upload Document”, “Download a Copy” option is available.
Can perform search by title of a document.
Able to see Title of document and can also rename the title.
Internally SharePoint treats both library and list as a list.

Sharepoint Document Upload Page - Passing URL Variables?

Throughout my SharePoint site, I have several document repositories that are tied to primary keys from an external database. I have added custom columns in the document library metadata fields so that we will know which SharePoint documents correspond with which table entries. As a requirement, we need to have document uploads that have these fields automatically populated. For instance, I'd like to have the following url:
./Upload.aspx?ClassID=2&SystemID=63
So that when you upload any documents to this library, it automatically adds the ClassID and SystemID values to the corresponding ClassID and SystemID columns outlined in the SharePoint document library fields.
Is there any quick or easy way to do this, or will I have to completely rewrite the Upload.aspx script from scratch?
I think the only way to go is to create your own Upload.aspx page. Read more here.
Unfortunately, it looks like going custom is the only option for now. Here are some tips on how to code the submission page.
There is a corresponding entry that describes how to add a document to a document library here:
How do you upload a file to a document library in sharepoint?
Likewise, once you have a document library file handler, you can alter its metadata column values using this method:
http://www.davehunter.co.uk/Blog/Lists/Posts/Post.aspx?List=f0e16a1a-6fa9-4130-bcab-baeb97ccc4ff&ID=109
Essentially it's just
SPFile.Item["ColumnName"] = "Value";

Sharepoint lookup column customization

I'm developing a customized document library in the SharePoint 2007 environment. What I'm doing is creating a content type with multiple columns of information related to the document. Users will use this content type to upload new documents rather than the standard new document functionality. One of my columns in this content type is proving to be more difficult than I can handle.
The column is essentially supposed to be a sort of 'related documents' column, where it offers the user the option to select another document that is related to this document. So I thought I'll create a lookup column that displays the titles of all other documents in the library and allows the user to choose one. Simple enough, but I need much more functionality than this...and here is where I need help.
I need the related document column to actually link to the related document, not just display the title...not in edit mode while a user is adding a document, just in the standard document library view after the document has been added.
I also need the link to include a url variable that is stored in another column named 'Document Number'.
I assume this will require custom coding which is fine. Please not that I can't use SharePoint Designer. I use Visual Studio and code must be C#. This will be packaged and released as a feature.
Can anyone help me acheive this? Example code, suggestions, etc...? Thanks!
I would suggest using a multi-column field as your base value type - this article on MSDN should get you started. For rendering the field in document library views, you will need to use a rendering pattern. Conveniently, MSDN has an example of a multi-column RenderPattern.

SharePoint custom content feature with Word Quick Parts and Document Information Panel

I am creating a custom content type feature for MOSS that will also include a Word 2007 document as the document template. The same Word document will also have a Document Information Panel (DIP) and Quick Parts for all the fields in the content type.
The problem is that when my feature is deployed the Word document's Quick Parts no longer seem bound to the content type's columns in the Document Library. For example, if you:
Type a value into the Quick Part
Save the Word document to the document library
Look at the documents properties;
The value just typed is not listed. However if you use the DIP to specify the value (instead of the quick part) and then save it, it does get saved as metadata.
The "Document Information Panel Settings" screen for my content type is acting as if there is no InfoPath template. Sure enough if I re-upload (or create a new) InfoPath template, then the above problem goes away.
How do I get this to work in my feature without having to do the manual step described above?
It may be possible to define a custom template for the DIP and deploy that to the site, setting the content type to link to that template.
I found a solution in a blog, but you have to use InfoPath... Here is the link:
Using SharePoint Metadata in Word Documents – The Lookup Column
http://vspug.com/maartene/2009/03/13/using-sharepoint-metadata-in-word-documents-the-lookup-column-issue/

Resources