SharePoint 2013 TaxonomyFieldType in custom list has IsTermSetValid = False - sharepoint

I'm using Visual Studio 2012 to create a custom Site Column of type TaxonomyFieldType, a custom content type that uses it, and a custom list that uses the content type.
Everything appears to deploy fine. If I look at my custom site column it appears to reference the proper termset correctly. I can create a new list in the web UI that uses my custom content type just fine. However, my custom list created using the Visual Studio 2012 List template always shows my taxonomy field as disabled on the new form. Here are the other things I've witnessed about it:
In the web UI of SharePoint, if I go to the list properties and drill into my taxonomy site column I notice it shows that it isn't mapped to a termset. Keep in mind that if I do the same thing in Site Settings for my content type it appears correct. I can do the same thing for the web UI created custom list and everything is fine (editable in the new form and the field has the termset defined).
If I use powershell to dump out the info for the site column itself it has a valid termset.
If I use powershell to dump out the info for the field in the VS2012 created list it shows emtpy guid for the SspId, TermSetId, and TextField. It also shows IsTermSetValid = False.
If I use powershell to dump out the info for the field in the SharePoint web UI created list it shows the correct guid for the SspId, TermSetId, and TextField. It also shows IsTermSetValid = True.
Does anyone know why I seem to be having this behavior for the VS 2012 create custom list? Any help is appreciated.

Okay, so I'm going to answer my own question. Hopefully this will help someone else in the future.
My issue was that when creating a sample list for my content type (described in original question post), using the SharePoint UI, the needed Note field was getting added. Even if I had this right in my original TaxonomyFieldType declaration, I would have also ran into issues with my field values not showing up in the search refiners later on when I got to that part. Thankfully Ari Bakker has written a very detail explanation of what all you need to do in order to create your custom TaxonomyFieldType derived field, a custom content type to use it, a list definition, and a list instance. Just follow the details in the article: http://www.sharepointconfig.com/2011/03/the-complete-guide-to-provisioning-sharepoint-2010-managed-metadata-fields/

Related

SharePoint 2013 on-prem Add-In EmailAssignTo on task list

I've created a Task List in my app web with a custom content type based on task. I want to be have an email sent when an item is assigned to someone.
Looking around it seems that adding EmailAssignTo="TRUE" to the List element in Schema.xml should do the trick however I see the following:
Warning 1 The 'EmailAssignTo' attribute is not declared.
EmailAssignTo doesn't seem to be documented by Microsoft. Am I going about this the wrong way?
Based on a quick PowerShell check/test the List property you want appears to be entitled EnableAssignToEmail, which expects a Boolean value.
Source documentation from MSDN:
https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splist.enableassigntoemail.aspx
SPList.EnableAssignToEmail property
Gets or sets a Boolean value specifying whether e-mail notification is enabled for the list.

New SharePoint List Fields not appearing in New or Edit form

I'm looking into an issue with a large SharePoint 2010 list (68 fields) where when the user tries to add new fields to the list, they do not show up.
I can successfully make changes to old fields, but every new field I add doesn't show up. However, they DO show up as an available field in SharePoint Designer and on the List Properties page.
I've tried enabling Content Type Management and making changes, (a common solution) but that didn't seem to help.
Anyone see this before?
While I don't know what caused this, the solution was to use SP Designer to create a new New Item Form. When I did that, the new custom columns appeared.
NOTE: Simply recreating the New form was not enough. I had to create a New Item form with a different name and set it as the Default for that type.

How to import GUID columns from SQL database via External Content Type in SharePoint 2010?

I am trying to read some columns from my CRM database in SharePoint 2010 list using external content type via SharePoint Designer 2010. But the GUID fields are refusing to be imported. By this, what I mean is, when I create an External List based on the External Content Type created in SPD, the list doesnt show the fields that are of GUID type. There is no error messages, warnings, or log file entries that explains this. Any ideas as to why this may be happening?
I am not trying to edit or write back to the database, simply read. I can read/see other fields fine in the destination list.
I have the exact same issue. For me I was hoping to Edit the GUID or add it, but since the External List does not show the GUID at all I can't do any of that. You stated you just need to read it though. You can get the GUID type columns to show up by creating a new PAGE and adding a Web part of type 'business data list' which connects to your External Content Type. Look at the link below...specifically the part half way down entitled "Deploy the solution and create new page to see the associated data lists". It is very useful to link up data between tables too using Business Data Related Lists.
http://blogs.msdn.com/b/vssharepointtoolsblog/archive/2010/08/02/walkthrough-of-creating-association-between-sharepoint-bdc-entities-using-visual-studio-2010.aspx

How to hide a custom field type from new column choices

I'm trying to figure out a clean way to hide a custom field type from the list of available columns when a user goes to add a new column to a list. I only want this field type to show up when a given feature has been activated (the feature could be site, web, or web app scoped for my purposes).
One theory (haven't had a chance to try implementing this yet) is that I could set all the ShowOnListAuthoringPages (and similar) properties to "false" in the fldtypes_myfield.xml file, then programmatically set this value to true when a given feature is activated.
In XML file, please set
<Field Name="UserCreatable">FALSE</Field>
I't work with me
Are you sure that you are able to see the Publishing Fields Type in the List Create Column Only with Publishing Infrastructure feature activated. I have a MOSS 2007 Server and I Create a Site Collection based on the Team Site (In this Publishing Infrastructure was not active) but still I was able to see the Rich HTML Fields in the Create Site Column Page. I doubt Publishing Infrastructure controls this function. Your option is good one for this, I would say.
Custom Field Types Features are per definition Farm Scoped, since Custom Field Types have to be deployed farm wide.
You cannot "hide" them from users. A field in a list is based on a field type (bool, user etc.). You CAN hide fields, not the base types. So if a user wishes to create an entirely new (site) column, he or she 'll be able to see that field type.
So, it does look like the only way to do really hide the field times is with attributes in the fldtypes_myfield.xml file. There are a series of properties that affect it's visibility described in this MSDN page. In my particular case I ended up just using the UserCreatable property and marking it as false. This pretty much means the field type won't show up in the UI anywhere, so you'll need to make a feature or some kind of list/library template that you deploy that makes use of the type. I guess this is an area we can hope for improvement on in SP 2010 (perhaps along with a scoping mechanism for event receivers so they don't have to be "global" in the farm).

How did I get multiple lists with the same name in my SharePoint site?

I have a SharePoint site that's being created from a custom site definition. The site definition has the following Features:
A custom content type.
A custom list template whose schema.xml file refers to that content type.
A list instance feature which refers to my above list template feature.
During the site provisioning process, I activate each of these features (each is at the SPWeb level) through C# code in the order above. My resulting site looks as I expect and seems to work fine, but it has the weird artifact that the "all site content" page for my site shows my custom list twice.
My list acts okay -- its item receivers fire correctly and only once. In SharePoint Manager (SPM), I also see the list show up twice, and when I expand the tree to look at the attributes, they appear identical across the two lists (even the list items inside the lists). I suspect that I may be fooling myself and SPM might be just looking at the same list twice, while some actual rogue list lies in the dark shadows of my site.
So, what could have gone wrong here? How could I have created multiple lists of the same name? How can I correctly create this list? And how can I properly clean up the weirdness in existing sites that exhibit this behavior?
Edit:
In response to Michael Stum's question, I created this console app to loop through the site's lists and get the ID:
using (SPSite site = new SPSite("http://myserver/projects/myproject"))
{
using (SPWeb web = site.OpenWeb())
{
var lists = web.Lists;
foreach (SPList list in lists)
{
Console.WriteLine(list.ID + ": " + list.Title);
}
}
}
This code shows my list twice -- same title, same ID.
Another edit:
I looked in the SharePoint content database for this site, and I executed this query:
SELECT * FROM AllLists where tp_webid = '<my SPWeb guid>'
This reveals that there's only one actual list with the title and GUID that I retrieved from my C# code above. So what is causing these multiple entries to show up when I'm browsing through my site?
I've come across with this issue several times. It's not a bug, most likely you have semantic errors in the elements.xml of your list template.
If a list definition contains more than one default view, the symptoms you described above will show up. Check the elements.xml file of your list template and make sure you don't have more than one View-Element with in it.
Kind regards
Ramon
I suggest you put a call in to Microsoft, this sounds like a bug.
P.S. without seeing the actual solution that creates the list we can't determine what's happening, perhaps a feature got activated twice...
Today I came across this issue and after reading the above answers I came up with an easy solution. Just create a new Default view and the Document library will show up normally again.
Kind regards,
Thijmen Groenewegen
P.s
I "created" the same two libraries by migrating the library from one place to another. At the old place the library was only showed once. If I look at the default views on that library two views are checked as Default.
Groenewegen is spot on.
I ended up with two Announcements lists on a site after I ran Export-SPWeb on a subsite and then Import-SPWeb to move it to a new site collection.
To fix it, I created a new default view for the list, All List Items, selected one of the two All Items views and deleted it, and the issue was fixed.
The Announcements list was being displayed twice on the View All Site Content page, and the data was being shown twice when viewing the All Items page.
Also, an intermediate step that you have to take before creating a new default view, is to open the list or library and add "?contents=1" to the URL so you can open the web part maintenance page and "Close" one of the duplicates. You have to do this because the web part ribbon will not show up on the Announcements page if multiple web parts exist, and you need the ribbon to access the view drop down and create a new view.
Have you tried with:
list.RootFolder.Name
(which shows the "internal" name - a part of the url)
list.Title shows the displayname (which can appear twice or more).
This could also be the explanation why you get multiple lists. You have maybe added them with the same displayname but dirrerent "internal" names?

Resources