Hot answers tagged site-column
9
Q: Is there a max number of columns in a sharepoint list?
A: SharePoint Server 2010 capacity management: Software boundaries and limits / Column limits
Q: Can we use reporting services to read from two lists?
A: Yes: if you are using SQL Server 2008 R2 reporting service
Q: Is it possible to display information from two lists in a single view even if the ...
9
The design intention of content types is to support re-use of the list schema (or behaviours). So if there is a requirement to create a lot of lists with the same structure, which is often the case, then the content type enables this. It would be unacceptable to have to create list schemas individually in this situation and would result in repetitive ...
8
Creating site columns is the right way to go. You can add a list column to a list or library that is associated with a content type, but it isn't the same. The point is really to define your data properly. I kind of think that it is more likely that you are "polluting" the environment when you create the same field 10x as a list field versus a Site ...
6
What Bill (@SPDoctor) said. It depends.
Related to #3, as the solutions you work with get larger, you will tend to split up your solutions across several Site Collections. Since Content Types has site collection scope, this can become a problem if you dont want to have redundant maintenance of your content types.
To solve this you can use the new SP2010 ...
5
You could utilize the content syndication hub and create a site column there. Add it to an item content type and syndicate that content type to all site collections. At which point that column should become an option to use in all site collections. This is in theory of course but it should work.
4
Out of the box, there is no easy solution. I recently had to move some site columns from development to production and had to resort to some custom PowerShell script. There's also no easy way to copy content types to another environment and/or collection.
In short, it can be done but you'd need to write some custom PowerShell to do it.
4
Isn't too difficult really, in the FeatureActivated method, you just create a new SPieldLookup (using SPWeb.Fields.AddLookup() for the SPSite's RootWeb), and set the properties for the SPFieldLookup as required.
First time doing it? Bit tricky if you've never made a FeatureReceiver before, let me know if you need a tutorial do that, and here's some sample ...
4
The solution is two fold - first the content type defination needs to have inherit set to false, and the title column needs to have sealed to true (see below). Second issue is that the view will still show title (but the add new item form will show the correct display name). To correct the view a custom list must be defined
<?xml version="1.0" ...
4
I have created a blog post on how to deploy a content type and its fields on SharePoint 2010 using Visual Studio 2010. Can you check if my approach is similar to yours?
http://www.koenvosters.be/post/howto-build-a-deployable-content-type-for-sharepoint-2010.aspx
4
SharePoint has no ability to assign meta-data to a Site Collectin or site directly. There are a few approaches to simulating it for the purposes of search and navigation:
1 - Use the Site Directory. although the 2007 Site Directory was deprecated, it still exists on SharePoint 2010 (for upgrade compatability) and you can turn it on and use it the same as ...
4
Yes, you can specify it. Example:
public static readonly Guid MyFieldId =
new Guid("{CC1E421C-29BE-4373-81D0-55D5D64B2E3D}");
public static readonly string MyFieldDefXml =
"<Field ID=\"{CC1E421C-29BE-4373-81D0-55D5D64B2E3D}\"" +
" Name=\"MyFieldName\" StaticName=\"MyFieldName\"" +
" Type=\"Text\" DisplayName=\"My Field Name\"" +
" Group=\"My ...
4
I am assuming you provisioned the column as a site column. So, the next thing is to make sure to push the changes to the down to lists and content types where this site column has been referred (which apparently you haven't done it). So, I would recommend to delete the old definition and provision the column again! See an example below where I am using the ...
3
Interesting - I used this very scenario (upgrading a field from text to note) in a demo recently in a conference talk, to show off SharePoint 2010's new upgradable Features framework. In both SP2007 and SP2010, changing the type of fields which are in use is unsuppported, as you've discovered.
My recommendation would be:
Take a backup in case rolling ...
3
The content types and columns won't be removed automatically when you deactivate the feature or retract your solution unless you implement a feature receiver to do this through the object model. Even then it will probably throw an exception if the content type is in use anywhere in your site.
If you need to make changes to a content type that you already ...
3
To the first question - yes. Some data is common across many places. For example, you might have a 'Financial Quarter' site column, and this could be used in many places; the financial quarter is still the financial quarter whether it's an expense request or a report of some kind, so it makes sense to be able to share that column between types. Conceptually, ...
3
I always create Site Columns and Content Types. Harsh experience has told me that anything implemented will probably seen as a cool idea by someone and will request it to be implemented elsewhere on the same site collection.
If you have a hierarchy of content types in use across multiple lists inside web sites, and a change request means you need to, for ...
3
Next time you perform the changes to the ContentType make sure to push changes to the lists while updating the ContentType.
For now, you might need to perform some clean-up job here, just to make sure the field is deleted from all the lists, with your Custom ContentType. Use the following PowerShell script for clean-up! VÄrsegod :)
Add-PSSnapin ...
3
You can use LinkToItem, LinkToItemAllowed and ListItemMenu properties of SPField. If you want field to show link to item's display form you need to set LinkToItem property to true and LinkToItemAllowed property to Allowed. If you want to add context menu to field you need to set ListItemMenu to true.
2
I've found this functionality to be quite buggy (there are several other problems not mentioned here that I've had). However this seems to be a reasonably reliable way to resolve this issue:
Create the columns and content type in the UI.
Save site as a WSP site template (turn off Publishing site feature first to see this option if necessary).
Import the ...
2
The parser that extracts fields from the feature manifest is very sensitive to stuff like comments in the manifest. Make sure you remove all HTML comments in the fields section, or you will not get any fields in your content type!
Theres several examples of this, also in feature upgrade. This is a real shame as this means you cannot document stuff inside ...
2
If you are using a farm solution, setting Inherits="FALSE" or removing the Inherits attribute in the child content type should solve your problem. This will also eliminate the need for the Feature receiver.
See this blog post for more information:
http://msmvps.com/blogs/windsor/archive/2011/05/02/custom-content-types-and-inherits-in-sharepoint-2010.aspx
2
You are looking to create a series of Cascade choice field in a SharePoint list, there is no such functionality OOTB. There is a number of community solutions with various technologies involved like: code (C#), javascript/JQuery and InfoPath.
You should probably start with SPServices library that has implementation of Cascade Dropdown with JQuery and nice ...
2
I dont see any problem with using something like "Field Office [Geographical Region]".
As far as displaying in list form is concerned, the display name can be changed from individual list settings. So "Field Office - US" and "Field Office - Europe" can be displayed as "Field Office" in respective region sites.
2
The only way to do that would be to use javascript/jQuery. The code that you posted runs server side and you have no control over the output. You'll have to do some front-end manipulation after the page has been rendered. Hopefully, SharePoint gives you a good hook onto these elements, otherwise, it could be rather difficult.
Here's some jQuery to help ...
2
Yes.
What you'd need to do is first add the new column to the Site Columns (SPSite.RootWeb.Fields), then add it to the FieldRefs of the SPContentType, again at the RootWeb level.
You then need to iterate over the ContentType Usages in that site, to add the column to whereever it's being used, to push the changes throughout the site. You'll need to do all ...
2
I still don't know how to really delete fields - but actually Overwrite="TRUE" OverwriteInChildScopes="TRUE" for the field WORKS!.
The second error message i received ("duplicate field names") is actually due to two identical fields being defined in my .xml file.
2
I have noticed that if you deploy a site column in a feature, then retract the solution, then deploy again, the feature is no longer listed in site columns. However, if you do an IISRESET and then check site columns, the column reappears. This suggests that SharePoint is cacheing the schema at some level. So my recommendation would be to force an iisreset ...
2
If you have a requirement to use site columns across site collections, you probably should consider creating a content type hub in order to centrally manage your content types. Even if you do not have the same content types in each site collection, you will probably be able to find a common base content type from which these would derive. This base content ...
2
You can create columns in three ways:
By using the SharePoint
user interface
By using the SharePoint object model
By deploying a Feature that installs the
column based on an XML definition
file
2
If you are just trying to avoid using declarative xml to create the column, you can write C# code to create the column. But to deploy to your site through a wsp, it will still need to be packaged in a feature.
You could write a console application that runs on the server and executes the code to create the column. However, this seems like more of a ...
Only top voted, non community-wiki answers of a minimum length are eligible
