Posts

Showing posts with the label Metadata

Create Metadata terms structure with CSV using Powershell

Tagging content is very important feature in SharePoint. This post will help you if you are planing to use tags and for initial configuration you don't want your client to manually create the 1000 of tags with a defined structure. So first thing needed to built this is well defined structure of the terms in Excel file. So that you can easily create CSV file from Excel. While creating this excel file make sure that all the terms you enter this should comes under ONE TERM SET. For other terms set you will be needing another csv file. You can take help from this sample csv file for creating site structure. Next, is to open the PowerShell and write some code. Below is the code functions used for importing excel file. function ImportTermSet([Microsoft.SharePoint.Taxonomy.TermStore]$store, [string]$groupName, [PSCustomObject]$termSet) { function ImportTerm([Microsoft.SharePoint.Taxonomy.Group]$group, [Microsoft.SharePoint.Taxonomy.TermSet]$set, [Microsoft.SharePoint.Taxonomy.Term]$paren...

Resolution of- The SPListItem being updated was not retrieved with all taxonomy fields.

Image
Hi guys, Let me first explain how I got this issue. While working on some client requirement, I was creating content type and page layout using visual studio. One metadata field has been created as a "site column" using element.xml file. To know, how to create custom metadata field, Please refer my previous blog . All was working perfect, which means I was able to map the custom metadata field with Metadata tag. But when I created a list using visual studio 2013/2012 designer to add field to list. It was giving this error after provisioning the list successfully. Transport Strange error, I was expecting Visual studio more intelligent then earlier. But i felt never trust any tool with your eyes closed ;). Root Cause: Let me explain what was happened. Newly created metadata column "Country" was refereed properly but associated note field was not added to list. Because of which it never work. Resolution: To fix this double click on the list on visual studio. List desig...

Managed Metadata Fields in Office 365/SP Online Sandbox Solution

Hi, Developing Metadata fields is always a complicated case of the developers. My previous posts( Add Metadata Taxonomy Custom Field using Visual Studio ) I explained how we can create metadata site columns. In this  post, I will target Office 365/SP online users who can only use sandbox solutions to update/create metadata fields. Reason why treditional solutions does not with Office 365 In practical scenario, Metadata service details like SSPID, Default term store etc keep on changing. I notice that the name of Metadata service of SharePoint Online keeps on updating after some updates. We all know that code  in sandboxed solutions is being deprecated by Microsoft. But even if we were happy to use sandboxed code - in Office 365/SharePoint Online, we cannot use the  Microsoft.SharePoint.Taxonomy  namespace in server-side code anyway – the net result is that we are unable to “finish the job” in this way to ensure the field is correctly bound to the Term Store. This is a problem! Even wor...

SharePoint DefaultSiteCollectionTermStore is null

Image
Hi, In my previous blog( Add Metadata Taxonomy Custom Field using Visual Studio ), I have explained how we can add custom metadata taxonomy custom field. In the feature code we have to write code to bind the field with the taxonomy term set. It can be one business requirement to get the taxonomy session for the current site. We all know there is a dll provided by Microsoft named "Microsoft.SharePoint.Taxonomy" found under ISAP folder. Using this Dll we can get access to current metadata service and default metadata term store by using the following code: var session = new TaxonomySession(<object of SPSite>); var termStore = session.DefaultSiteCollectionTermStore; I just used this code but unfortunately this object returns me null :). Then after spending few hours I found that there is a configuration which allow us to behave term store as default term store. Follow the below steps to resolve this: 1) Navigate to "Central Administrator > Application Management...

Add Metadata Taxonomy Custom Field using Visual Studio

Image
Hi, Custom Taxonomy Field creation is very common requirement while working with the different clients. In this post I will explain how we can create a custom metadata type column. Once metadata field is added as site column, it can easily be added as custom list column or field to any of the content type. Step 1: Create a fresh project of type "SharePoint 2013 Project". After providing basic properties of project like Farm/Sandbox solution and SharePoint site Url project is ready to add field into the site. Step 2:  Now its optional to create new folder "Site Columns" as per the project coding standards. But in case you are adding multiple custom columns then I recommend to add a new folder as I did. Step 3 : Next, Just hit right click on the project/folder and say "Add > New Item" from the menu options. Then select "Site Column" from the item list. Give any relevant name to your column. Step 4 : After you hit "Add", a new module...