Monthly Archives: September 2012

How to create a separate Infopath View for viewing only, for an infopath List Form in SharePoint 2010

 In InfoPath 2010, got to Page Design, new View:

 Copy the whole view from the Edit View, then paste into the new view and clean up any fields (for example take out descriptions).
Save the view as “DisplayView” or another name.
Set it as the default for viewing under Form Options:

By |September 25th, 2012|Sharepoint on Premise|0 Comments|

Delete All User Alerts for a SharePoint Site Collection

In SharePoint 2010, you can turn off all alerts through Central Admin under Application Management, Web Applications, General Settings:

 

 Another option is to write a little utility.

 I wrote a little WinForms utility to delete all user alerts in a site collection. We needed this when we backposted a content database from Production down to QA. We didn’t want to start firing alerts off the QA environment so you could either disable SMTP outgoing email or just wipe the alerts.

 How to do it: Create a WinForms Application in Visual Studio, add a few fields, buttons, radios.

 The Verify Alerts just checks your data without actually deleting it so you can see what you would have deleted.

 

 
 using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.SharePoint;

 namespace DeleteUserAlerts
{

public
partial
class
Form1 : Form
{

public Form1()
[...]

By |September 12th, 2012|Sharepoint on Premise|0 Comments|

Migrate Alerts from old SharePoint url to new SharePoint url

Here’s a handy powershell script to migrate all alert url’s.

 Problem: When you perform a content database migration to a new SharePoint farm with a different url, the alerts will not fire as the url’s are stored from the previous farm.
For example, migrating from “Intranet” to “IntranetQA” will not work as the old url’s are stored.
Here’s the script:
http://gallery.technet.microsoft.com/ScriptCenter/877d2abd-fce9-4545-b223-7637936dd888/

By |September 12th, 2012|Uncategorized|0 Comments|

Customize Infopath Forms in SharePoint 2010 changes color theme to default blue (no visual upgrade)

I ran into this one when trying to customize a SharePoint 2010 form using the “Customize Form” button to add some custom colors on an InfoPath form for a SharePoint list. If you perform a visual upgrade in SharePoint 2010 everything works fine. However, if you do not do the visual upgrade, the page does not respect your color theme and reverts to the default “blue” theme.

By pressing F12 in Internet Explorer, you can see what is going on:

Notice how the core.css file is written out correctly and then overridden by the Obsidian color theme correctly.

However, what is happening is that Infopath is adding another reference to core.css after the Obsidian color theme.

Lines 7 and 8 of the “View Source” html show the correct order of CSS references with Obsidian after core.css

However, InfoPath adds the following reference to core.css which overrides the Obsidian theme on line 30.

Solution:

Open the Editifs.aspx [...]