Wednesday, June 6, 2007

SharePoint List Extension

Na de Macaw extension in grote lijnen te proberen begrijpen, heb ik een poging gedaan om het geheel te laten werken. Het enige dat maar niet wil werken, is het toepassen van een query op de SharePoint List. Zoals te zien in onderstaande screenshots krijg ik de volgende error: There is an error in the query. Object reference not set to an instance of an object.




Op Teun.ToString() website zijn er vele andere mensen die hiermee problemen hebben. Als iemand een oplossing weet, laat het me weten! ;)



Pass parameters to InfoPath Form

In some cases it might be handy to pass some parameters to the InfoPath form. Example: It would be nice if users don't have to complete their account data (Name, Surname, E-mailadress,...). In this case you have a few options:

  1. Access SharePoint webservices to retreive the data (UserProfile.asmx)
  2. Write some code behind the InfoPath Form (as exposed below)
  3. By using Contact Selector ActiveX control

InfoPath codebehind method:

In the Loading event of the form template, we have to catch the parameters with the TryGetValue method.

public void FormEvents_Loading(object sender, LoadingEventArgs e)
{
string Naam = string.Empty;
try
{
e.InputParameters.TryGetValue("naampje", out Naam);
}
catch (Exception ex)
{
Naam = ex.Message.ToString();
}

finally
{
MainDataSource.CreateNavigator().SelectSingleNode
("/my:myFields/my:voornaam", NamespaceManager).SetValue(Naam);
}
}


Afterwards, you can pass a parameter through the URL. Add a querystring at the back of the URL eg. &naampje=kieseennaam

Monday, June 4, 2007

Calculated Columns (Part 2)

Het is wel degelijk mogelijk om een calculated column als site column te definiƫren. Mijn fout zat in het verwijzen naar het StartDate field. Eerst moet men een field StartDate (site column met als type DateTime) aanmaken en daarna hiernaar verwijzen (fieldref) in de calculated column feature.

De oplossing vindt je op Jopx terug.

Sunday, June 3, 2007

Thank message after a submitted InfoPath Form

It's possible to let appear a 'Thank you' message to the person who submitted the InfoPath Form. You can do this by working with Views in InfoPath. On the first view (the main form) we place a button with the following rules: Submit using a dataconnection & Switch new view. With these rules we tell InfoPath to store the new form in a form library and after that it must switch to another view (the second form). The next thing we need to do is creating the message on the new view. That's all!