Hot answers tagged list-definition
8
So, after a few weeks on and off trying to figure this one out, having no luck with any replies on any forum, I just thought I would have a look at how the UI page was doing this. (Why didn't I think of this earlier?!)
That's when the property EnableMetadataPromotion showed up.
Having this keyword to search for, it didn't take me long to google the missing ...
8
You can retrieve the schema of any list by using the owssvr.dll call from your browser. Following is the syntax:
http://YOUR_SERVER_URL/PATH_TO_SITE_CONTAINING_LIST/_vti_bin/owssvr.dll?Cmd=ExportList&List={YOUR_LIST_GUID}
By replacing the Server and List GUID in above url will return you the XML Schema of the list.
This works on both 2010 and 2007.
...
7
The property mentioned by djeeg works if it is set on the list element in your schema.xml:
<List Title="A List Definition"
...
NavigateForFormsPages="TRUE">
This is the equivalent to setting "Launch forms in a dialog" to "No" under advanced list settings. It doesn't show up in the schema, but I've verified that it is still effective.
5
The "problem" is that every list and library is bound to a content type. Unfortunately Microsoft hided that by disabling "Allow Content Type Management" by default. When you create a new field like you did it is added to the list but not bound to the content type the list depends on. If you go to the list settings and enable Content Type management you can ...
5
Well, basically because in your CAML declarations you are performing three different operations.
Let me explain this in a simpler way.
You first define the field as Site Columns in your element file (sample shows the declaration of one of the OOB field):
<Field ID="{8c06beca-0777-48f7-91c7-6da68bc07b69}"
Name="Created"
...
4
This can be done either by setting EnableContentType=true in the list definition or in the feature activation event we can set the attribute. Please refer the below links. They will definitely help you in solving your problem.
http://snahta.blogspot.com/2009/02/enable-managing-content-types-by.html
http://msdn.microsoft.com/en-us/library/gg276355.aspx
...
4
The SPList.BaseTemplate property tells you what list definition was used to create a given list.
Also, LINQ is by far the most efficient way to query all the lists in your site -- and this could obviously be extrapolated to query all lists within an entire site collection too (see Example 2 here). Creating nested "foreach" loops to manually enumerate all ...
4
Turns out I had made a wrong assumption. I thought the formula used the internal name of the field, but it actually uses the DisplayName. So either changing DisplayName to TestDate or changing the formula to TEXT([Test Date],"MMMM") will fix the problem for me.
It caught me out for so long because I had copied the fields out of an exported ...
3
In SharePoint Foundation, there is only one option when you need some OOTB column for displaying picture: use 'Hyperlink or Picture' column. This column is represented by SPFieldUrl class, which have DisplayFormat property, which can be either Hyperlink (default) or Image.
In CAML (i.e. in schema.xml), you will need provide following attributes to Field ...
3
Hello Michal: There is nothing out of the box that would offer that functionality. Indexes are unique on a per column-basis and each column index is independent. The ItemUpdating event receiver is the best place to do this. You could simply have the event receiver query the list to see if a duplicate record exists before the item is created or saved.
3
I assume you want to create a list definition based on existing list definition that comes with SharePoint or installed by other solutions.
I would just use the VS.NET > Add New Item > List Definition and select Custom List as base.
Then locate the existing list template directory in SharePoint root and copy
1) schema.xml and
2) element file ...
2
Removing the ContentTypes reference isn't necessarily the right way but I'm pretty sure it's the wrong way. They're there for a reason.
You have two options. First, you can create a content type and specify the fields that way. See http://msdn.microsoft.com/en-us/library/ff728096.aspx for information on how to build up the custom list through a content ...
2
Upgrading artifacts depends on the type of artifact in question, and depending on the platform (MOSS vs SP2010).
In SharePoint 2010 question the story is different than in SharePoint 2007, since you have feature upgrade, both declaratively and programmaticly (feature upgrade event handler with parameters set declaratively). Further info regarding feature ...
2
First, a list definition and a list template are not the same, even though the api treats them as if they are. As far as I know, list definitions do not appear in the template gallery.
You say you are able to create lists from your custom template using the web interface, so I'll assume you have the feature defined with the list definition in it and that ...
2
WHat do you mean by "options available to fields". Do you mean you want to add extra Choices to a Choice field used in the list? If so, create a feature with a feature receiver and access the SPList, the the available fields in the list, get the field you want to update, Cast it to a SPFieldChoice, add the new values to the Choices collection and call the ...
2
The deployment and implementation included in Wictor's article is only suitable for 2010 due to how the solution package would be deployed and how the custom web part is referenced in the custom page. In 2010 sandboxed webparts are referenced using the SPUserCodeWebPart wrapper which does not exist in 2007. In 2007, you can reference the web part directly ...
2
If I'm not wrong you can create site template and then import this template in Visual Studio 2010. When the template is imported, you can choose what elements do you want to include in new solution. You can choose your list. The VS2010 creates all needed files. After this you can simply package this solution.
2
Well you made changes to List Schema definition, changes will only be applied to New Instances of List not to existing one. You have to write additional Upgrader feature which will Add the view programatically.
You can also look into the http://www.sharepointnutsandbolts.com/2010/06/feature-upgrade-part-1-fundamentals.html (Upgrade Feature Concept in ...
2
As mentioned, create a project with multiple features. Here is how I typically do it:
Feature 1 = Site Columns and Content Types (sometimes I'll separate
Content Types into different features)
Feature 2 = List Definitions (aka List Templates)
Feature 3 = List Instances (if applicable)
Feature 4 = "empty" feature with Activation Dependencies on the ...
2
I don't think there is some other way to keep list definition synchronized if you make changes to deployed list via UI.
For future reference I have found a quick tutorial on how to do this:
Simple Way of Creating a SharePoint 2010 Custom List Definition
However since you are developing custom list definition in Visual Studio the 'proper way' to achieve ...
2
Do you want to get the information through code, or only through the UI? For example the ListTemplateId can be found as variable when you look at the source code of the site where the list is displayed (for example: var g_wsaListTemplateId = 100). You can get this value with javascript.
Or you can use server API: ...
2
I'm not 100% sure which users should be allowed to do what, but if you need to give difference Controllers control of difference list items then you could look at Setting item level security in an eventhandler
2
Make sure that the FeatureId attribute in your ListInstance matches the ID of the definition's feature.
Make sure the Type attribute in your ListTemplate element matches the TemplateType of your ListInstance (in your case, 2010001)
Put both at the same scope. If the definition is at the same scope as its list instance and properly referenced, SharePoint can ...
2
@Kate Ponomareva
sorry for the delayed reply (wasnt online), follor below steps to add html form webpart
1 : through SPD create your required forms for the respective list and make them as default or you could use the default form itself
2 : go to your sharepoint site, click on the list from View All Site content or Quick Launch
3 : in top ribbon click on ...
2
Trying to change the display name of the Title is going to be an uphill struggle: There are several versions of the same column, each with their own DisplayName (some of which are created in the list).
If you open your list in SharePoint Manager, you'll see the various hidden Title fields.
My advice would be to hide the title field (Hidden="TRUE" in the ...
1
Manually: Go to the list settings and under the "Content Types"-section you can find the button
"Change new button order and default content type ", click there and deselect the checkbox for "Item" to make it invisible. Deleting this is not possible, but you can hide it for the users...
Programming: Put an eventhandler on the list, when it's created remove ...
1
I think you're gonna have to find all lists that use your template using a SPSiteDataQuery. This is scoped to an SPSite, so you're gonna have to run this against every site collection in your web application(s).
You'll have to iterate the web applications in the farm before you iterate the sites. Not sure how much is changed since 2007 (there has been ...
1
Your Content Type Id is in wrong format:
Content Type IDs
Isn't it maybe: 0x0100CE2744E3BAEA4734B2333D043AA5DD2C (if parent type is item)
Edited
By using SPContentTypeCollection.BestMatch Method it is possible to avoid 'confusion' of what is the right ContentTypeId.
Searches the collection and returns the content type identifier (ID)
that is the ...
1
Make sure your format to pick the name from the Resource file is:
Name="$Resources:MyResources,ListInstance_News"
MyResources - name of the resources file (as described below)
ListInstance_News - the resource entry
And the name of Resources file (for the entry above) for English should be:
MyResources.en-US.resx
And deployed to:
...
1
What you are doing (changing the XML schema of a field or content type while it is in use) is unsupported. ANY changes to fields done AFTER deployment and usage should be done using code (or in SP2010 using FeatureUpgradeActions! This is because the schema is saved (ghosted) to the content database.
Furthermore, it is not possible to have the same schema ...
Only top voted, non community-wiki answers of a minimum length are eligible
