When working with web parts where the controls are built on the fly based on user input, it seems to be easier to use fixed IDs for the controls which you know about up-front. (note to self…)
Friday, August 07, 2009
Monday, July 27, 2009
InfoPath Property Promotion
When working with InfoPath Forms Services, the properties I was choosing to promote from the form were not appearing in the target list. It turned out that SharePoint was creating the required fields correctly as Site Columns, but they were not being added to the list.
Manually adding the Site Columns to the target list caused the properties to be promoted correctly when the form was submitted.
Tuesday, July 14, 2009
The template you have chosen is invalid or cannot be found. – SharePoint STP Fix-up
Copy the STP and rename as CAB
Extract the manifest file
Run the FeaturesChecker (code below) application to remove the missing refs..
Remove the offending features from the manifest
Use Cab File Maker (freely available) to rebuild the cab and rename to STP
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;
using System.Collections;
using System.Xml;
using System.Diagnostics;
namespace FeaturesChecker
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
List<string> siteFeatures = new List<string>();
using (SPSite bob = new SPSite("http://localhost/sites/bob%22))
{
foreach (SPFeature currentFeature in bob.Features)
{
ListViewItem newItem = listView1.Items.Add(currentFeature.DefinitionId.ToString());
//newItem.SubItems[0].Text = currentFeature.Definition.DisplayName;
siteFeatures.Add(currentFeature.DefinitionId.ToString());
}
using (SPWeb rootWeb = bob.OpenWeb())
{
foreach (SPFeature webFeature in rootWeb.Features)
{
siteFeatures.Add(webFeature.DefinitionId.ToString());
}
}
}
List<string> manifestFeatures = new List<string>();
XmlDocument manifest = new XmlDocument();
manifest.Load(@"C:\Customers\Bob\upf2\manifest.xml");
try
{
XmlNode manifestSiteFeatures = manifest.SelectSingleNode("Web/SiteFeatures");
foreach (XmlNode featureNode in manifestSiteFeatures.ChildNodes)
{
manifestFeatures.Add(featureNode.Attributes["ID"].InnerText);
}
}
catch (Exception noSiteFeatures)
{
Trace.Write("No Site Features");
}
XmlNode manifestWebFeatures = manifest.SelectSingleNode("Web/WebFeatures");
foreach (XmlNode webfeatureNode in manifestWebFeatures.ChildNodes)
{
manifestFeatures.Add(webfeatureNode.Attributes["ID"].InnerText);
}
listView1.Items.Clear();
int numMissing = 0;
foreach (string currentFeature in manifestFeatures)
{
if (!siteFeatures.Contains(currentFeature))
{
ListViewItem newItem = listView1.Items.Add(currentFeature);
textBox1.Text += currentFeature + "\r\n";
numMissing++;
}
}
MessageBox.Show(numMissing.ToString());
}
}
}
Wednesday, June 17, 2009
SharePoint Workflow InfoPath Task Forms
If you don’t see the InfoPath form you were expecting when you open a workflow task, make sure you have added:
TaskListContentTypeId="0x01080100C9C9515DE4E24001905074F980F93160" >
to the workflow.xml file….
Thursday, June 11, 2009
Working with VSTO – Entry Missing from Add Remove Programs
Whilst updating Office 2007 Add Ins, I ran into a situation where the new version wouldn’t install because VS was convinced there was a version installed, but Add Remove Programs had no item for it. The installer was giving the following error:
The customization cannot be installed because another version is currently installed and cannot be upgraded from this location. To install this version of the customization, first use Add or Remove Programs to uninstall this program:
The only way I found to fix this was to re-install the old version, which caused the Add Remove entry to appear. I could then remove the old one and successfully install the new one..
Friday, April 24, 2009
Web Service access to Paradox data
In attempting to retrieve data from a Paradox database using the Jet OleDB provider, I ran into a strange issue, whereby the data could be retrieved succesfully using a console app, but the identical code would error when executed in a web-service method.
The problem turned out to be permissions. By using the <impersonate> tag in the web-config of the web-service, and specifying a relevant account, the web-service method worked.
Monday, February 16, 2009
Record(s) cannot be read; no read permission on
Trying to access data in an Access DB, I kept getting the error above..
A bunch of good sites provide the required connection strings, but in order to get it working I had to specify the FULL path to the System.mdw, i.e.
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=[full path to DB];Mode=Read;Jet OLEDB:System database=[full path to mdw file]
Monday, February 09, 2009
Error 1001 – Windows Service Installation
Using the VS2008 tools to create a Windows Installer, I got into a loop whereby it wouldn’t uninstall the service, because it thought the service wasn’t installed, and it wouldn’t install the service because it decided the service was already installed !!!
To cure the problem, ran sc command at the prompt with the delete switch and the name of the service (from the services admin tool).
After that, the VS installer was sorted…
Thursday, February 05, 2009
Customize the Outlook Ribbon with Visual Studio 2008
I couldn’t find much in the way of posts about customizing the Ribbon in Outlook 2007 using VSTO 2008.
It’s actually really nicely implemented – just not particularly documented…
To get started, in your Add-In, add a Ribbon Designer class.
Add a button to the Ribbon.
In your button event handler, you can access the properties of the parent AddIn using :
Globals.[AddInClassName].[Exposed property]
Wednesday, January 21, 2009
Outlook ItemsEvents_ItemAddEventHandler
If you setup an event handler for the ItemAdd event within a folder you MUST have a class level variable for the ITEMS collection, otherwise the event will not fire reliably. Having a class level variable for the Folder which contains the items does not work…
Feedburner RSS