Posts

Showing posts from May, 2014

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

Get Comment Count in SharePoint

Hi Guys, In this blog I will explain how we can get the number of comments on any page/article. Prerequisites for this blog are: a list with rating enabled, an article/page/splistItem already have got comments from users and a tool like VS to code ;) According to requirement it may be the case that one need to get item comment count using java script or c#. I will explain both way to get the comment count: Using Javascript: This may be the case when one want to use the content search webpart or CQWP to display comment count. Followng code can be use to get the comment Count: var linkURL = $getItemValue(ctx, "Link URL"); linkURL.overrideValueRenderer($urlHtmlEncode); // Get the Comments count var soapEnv = "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'> \ <soap:Body>    \ <CountCommentsOnUrl xmlns='http://mi

Schedule daily SQL Database Backup

Hi guys, In practical cases we require backup and restore facility to our database which provides an essential safeguard for protecting critical data stored in SQL Server databases. To minimize the risk of catastrophic data loss, you need to back up your databases to preserve modifications to your data on a regular basis. Backup and restore strategy always protects databases against data loss caused by a variety of failures. Purpose and Scope: In this blog, I am going through step by step that will allow Users to schedule the backup to be taken on a particular interval Delete the backup copies after a certain period of time Prerequisites: SQL server 2000/2003/2008/2012 SQL server Agent (Up and running state) Steps:  Schedule the database backup Steps: Make sure that SQL agent is in running state: Go To SQL Server Configuration Manager > SQL Server Services > Run SQL Server Agent (Set it to Run Automatically) If you are using new versions of SQL server then, Go To SQL

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