Tuesday, July 7, 2009

InfoPath 2007 Template Parts

Finding tough to keep the he sections, tables, fields, data connections and dropdown lists consistent between all forms.

The InfoPath 2007 was released and it has a new feature called Template Parts. Template Parts is a new type of InfoPath template that allows for predefined forms to be saved and then imported into the InfoPath Controls Task Pane. A Template Part is capable of saving Data Connections, Rules, Conditional Formatting, Data Validation and many other things. Just having this capability has saved me a tremendous amount of time when designing forms and it has increased the ROI for the client. A standard address block is one of the first things that I create for a new client because I'm able reuse it right away and show immediate ROI. At first you might not think this would have a big impact but when you take in account that, you no longer have to worry about defining the data source fields, layout table, field widths, colors, font style/size, data connections for states/regions and country, data validation, rules or conditional formatting then the ROI is reached pretty quickly. Once I understood this capability it changed how I started developing forms.

A feature of a Template Part that you need to take in consideration when using them to help designing forms is the Update capability. The Update capability allows for existing Template Part control on a form to be updated once the master Template Part control has changed and re-imported into the designer. At first this capability was frustrating because I didn't design everything with this in mind but after understanding how it worked, I quickly changed how I was designing forms and took advantage of the Update capability.

Long story short, Template Parts are great if you put thought into how you are building and using them. If you don't do this then it will just adds more complexity when building your InfoPath form and shouldn't be used.


Thursday, July 2, 2009

Infopath - Edit in Browser + Close = "The form has been closed." Annoyed?

(12Hive)\TEMPLATE\FEATURES\IPFSSiteFeatures\FormServerEcbEntry\EcbEntry.xml

Refer
http://geek.hubkey.com/2007/01/infopath-forms-services-close-button_17.html

Forcefully Activate "IPFSSiteFeatures" feature scoped to WebApp.
iisreset / recycle the application pool.

It must take you back without the annoying page "The form has been closed."
Update your upgrade document to redo the changes after the upgrade as upgrade may reset this feature.

Monday, June 29, 2009

Sharepoint Site Creation Notification Email

Steps Involved:

1. Create an event reciever
2. Create a feature to call the reiever when activated.
3. Create a feature stapler to staple the feature to Site Defs.

public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
SPWeb CurrentWeb = properties.Feature.Parent as SPWeb;
String Body = "A Sub Site Created with Title \""+ CurrentWeb.Title+ "\" with the URL "+CurrentWeb.Url;
foreach (SPUser user in CurrentWeb.Groups["AllAlerts"].Users)
{
SPUtility.SendEmail(CurrentWeb, false, false, user.Email, "Site Creation Alert", Body);
}
}

//Use the sharepoint inbuilt capability of sendin and email fron the SPUtility

Tuesday, June 9, 2009

List Template Id

ListId - Description
100 Generic list
101 Document library
102 Survey
103 Links list
104 Announcements list
105 Contacts list
106 Events list
107 Tasks list
108 Discussion board
109 Picture library
110 Data Sources list
111 Site Template Gallery
113 Web Part Gallery
114 List Template Gallery
115 XML Form Library (InfoPath)
120 Custom grid for list
200 Meeting Series list
201 Meeting Agenda list
204 Meeting Decisions list
207 Meeting Objectives list
210 Meeting text box
211 “Things to Bring” Meeting list
212 Meeting Workspace Pages list
300 Portal Sites list
1100 Issue Tracking list
2002 Personal document library
2003 Private document library

Friday, June 5, 2009

Sharepoint Banner

  1. Create you banner.jpg and 
  2. Copy to C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\IMAGES
  3. Make modification in the core.css as shown below.("C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033\STYLES\CORE.CSS")
Before Modification:
.ms-globalbreadcrumb{
font-size:8pt;
text-align:right;
background-color:#ebf3ff;
padding:2px 10px 2px 5px;
}

After Modification:
.ms-globalbreadcrumb{
font-size:8pt;
text-align:right;
background-color:#ebf3ff;
background-image:url("/_layouts/images/banner.jpg");
padding:2px 10px 79px 5px;
}

Tuesday, June 2, 2009

Override BDC default Action

Create a new Property element in the Properties element of the Entity.  Give it an attribute of DefaultAction and specify the name of the Action we defined earlier. 
Default

Specify your custom Actoin with Name="Default".

eg.        
      Action Position="1" IsOpenedInNewWindow="false" Url="{0}" ImageUrl="" Name="Default"
    

When you import the application definition, you will receive a warning like the following. 
"Could not create profile page for Entity MyEntity.  The error is: Default action exists for application ‘MyInstance’, entity ‘MyEntity’.  Profile page creation skipped.
This really isn’t an error.  It is just telling you that since you specified a default action, it did not automatically generate a profile page for the entity.