ARTICLE

New Icon Indicator in SharePoint 2010

Posted by Vijai Anand Articles | SharePoint 2010 June 24, 2011
In SharePoint, when a new item is created in the list or library a new icon will appear. In this article we will be seeing how to change the duration of the new icon and how to delete the new icon for the list or library.
Reader Level:

Introduction:
In SharePoint, when a new item is created in the list or library a new icon Untitled-1.gifwill appear. In this article we will be seeing how to change the duration of the new icon and how to delete the new icon for the list or library.

  • Set the duration of the new icon.
  • Remove the new icon.

Set the duration of the new icon:

In this section, we will be seeing how to set the duration of the new icon using object model and PowerShell.

Using Object Model:

using System;
using System.Collections.Generic;
using
System.Linq;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration;
namespace NewIcon
{
    class Program
    {
        static void Main(string[] args)
        {
            SPWebApplication webApp = SPWebApplication.Lookup(new Uri("http://serverName:1111/"));
            Console.WriteLine(webApp.DaysToShowNewIndicator.ToString());
            webApp.DaysToShowNewIndicator = 3;
            webApp.Update();
            Console.WriteLine(webApp.DaysToShowNewIndicator.ToString());
            Console.ReadLine();
        }
    }
}

Using PowerShell:

$webApp=Get-SPWebApplication "http://serverName:1111/"

write-host -f Magenta $webApp.DaysToShowNewIndicator

$webApp.DaysToShowNewIndicator=3

$webApp.Update()

write-host -f Magenta $webApp.DaysToShowNewIndicator

Remove the new icon:

In this section, we will be seeing how to remove the new icon using object model and PowerShell.

Using Object Model:


    SPWebApplication webApp = SPWebApplication.Lookup(new Uri("http://serverName:1111/"));
    Console.WriteLine(webApp.DaysToShowNewIndicator.ToString());
    webApp.DaysToShowNewIndicator = 0;
    webApp.Update();
    Console.WriteLine(webApp.DaysToShowNewIndicator.ToString());
    Console.ReadLine();

Using PowerShell:

$webApp=Get-SPWebApplication "http://serverName:1111/"

write-host -f Magenta $webApp.DaysToShowNewIndicator

$webApp.DaysToShowNewIndicator=0

$webApp.Update()

write-host -f Magenta $webApp.DaysToShowNewIndicator

Login to add your contents and source code to this article
post comment
     
COMMENT USING
PREMIUM SPONSORS
Over-C is a holistic consortium of communications and technology specialists. We build, deploy and market both business as well as consumer products and solutions.
Join a Chapter
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.