Thursday, October 18, 2007

Creating "Calculated Field" columns in SharePoint 2007

You can pretty much use the same VBA syntax for calculated fields as in Excel. Here is a site that provides many examples of common formulas that can be used in SharePoint when defining "Calculated Field" columns.
Here is a formula that I created at work:
=IF(YEAR([Due Date])=1899,"No Due Date",TEXT([Due Date],"MM/dd/yyyy"))
Blank dates in SharePoint are assigned a date in year 1899. The above formula displays a message "No Due Date" for invalid dates or the valid date using format MM/dd/yyyy.

Sunday, October 14, 2007

Speaking at DevTeach in late November 2007

I am scheduled to speak at the DevTeach conference in Vancouver on Wednesday, November 28, 2007 from 11:00 AM to 12:15 PM. The topic I will be presenting is the same topic I gave to the .netBC group on Wednesday September 12, 2007. That presention took 2 hours. Therefore, I must shave off about 45 minutes from that presentation.

The DevTeach conference is moving outside of Montreal for the first time. I attended it twice in spring 2005 and spring 2007. It is definately a very worthwhile conference. If you want to be on top of current and up-coming technologies in our very fast moving profession, it is a good use of three days.
Jean-Rene Roy, who is the owner of the DevTeach & SQLTeach shows, is organizing a very different type of conference in Vancouver. New to Vancouver will be an XNA track, a Halo-3 competition, and a free beer party with Palermo. It looks like it is going to be a lot of fun. Here is more on the various activities:
XNA contest: http://www.devteach.com/contest.aspx
Party with Palermo! Free beer: http://www.partywithpalermo.com/
For the first time a XNA track at a independent conference: http://www.devteach.com/Session.aspx#79
Three very good Pre-con Post-Con:

http://www.devteach.com/PreConference.aspx

http://www.devteach.com/PostConference.aspx
Key note by Ken Levy on VSX: http://www.devteach.com/Keynote.aspx

How to hide "View All Site Content" link for anonymous users in SharePoint WSS 3.0?

This solution requires you to install Microsoft Office SharePoint Designer.
  • Go to "Site Actions" ==> "Site Settings"
  • Under Galleries, click on "Master Pages"
  • Select default.master and select "Edit in Microsoft Office SharePoint Designer".
  • In "Design" view locate "View All Site Content" on the left-hand-site navigation bar and click on it.
  • Go to "Code" view. You will see the following code highlighted: 
<Sharepoint:SPSecurityTrimmedControl runat="server" PermissionsString="ViewFormPages">

<div class="ms-quicklaunchheader">

<SharePoint:SPLinkButton id="idNavLinkViewAll" runat="server" NavigateUrl="~site/_layouts/viewlsts.aspx" Text="<%$Resources:wss,quiklnch_allcontent%>" AccessKey="<%$Resources:wss,quiklnch_allcontent_AK%>"/>

</div>

</SharePoint:SPSecurityTrimmedControl>
  • Change the PermissionString attribute value of the Sharepoint:SPSecurityTrimmedControl XML element from ViewFormPages to BrowseDirectories.
  • Save the default.master. If you login as an anonymous user you will not see the "View All Site Content" link. However when authenticated you will see this option.
NOTE: The "BrowseDirectories" permission is common to both the "Members" and "Owners" group permission levels, but is not set for the "Limited Access" (anonymous users) permission level. See a complete list of the SPBasePermissions Enumeration here.

Tuesday, October 9, 2007

Adding command prompt option to Windows Explorer in Windows 2003 server

1. Navigate in your Registry to
HKEY_LOCAL_MACHINE/Software/Classes/Folder/Shell and create a key called "Command Prompt" without the quotes.
2. Set the default string to whatever text you want to appear in the right-click menu
3. Create a new key within your newly created command prompt named "command" and set the default string to:
Cmd.exe /k pushd %L
4. The changes should take place immediately. Right click a folder and your new menu item should appear.

Friday, October 5, 2007

Making a SharePoint custom column visible in an edit list form

  1. Go to the list you are interested in
  2. Click Settings --> List Settings
  3. Under General Settings --> Click Advance Settings
  4. Click "Yes" for "Allow management of content types?"
  5. Click "OK"
  6. Click the list you are interested in under "Content Types"
  7. Now Click "Add from existing site or list columns"
  8. Click "Add >" to select the columns you want
  9. Click "OK"
  10. Go to the list you are interested in
  11. Click Settings --> List Settings
  12. Under General Settings --> Click Advance Settings
  13. Click "No" for "Allow management of content types?"

Thursday, October 4, 2007

How to get list and view GUIDs in WSS 3.0 or MOSS 2007?


List GUID

View GUID

Wednesday, October 3, 2007

Finding out the SharePoint list ID (ListTemplateId)

SharePoint 2007 offers an enhanced ability to catch certain user events such as ItemDeleting (before the fact) and ItemDeleted (after the fact). The API targets specific lists identified by list IDs. Example:


List template type
Template ID
Custom List
100
Document Library
101
Survey
102
Links List
103
Announcement List
104
Contacts List
105
Events List
106
Task List
107
Discussion Board
108
Picture Library
109




You can find out the list ID of any other list as follows:


  • Go to your 12 hives FEATURES folder C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES
  • Find the folder for the list you are interested in and open it.
  • Open the ListTemplates folder
  • Open the XML file and read the value of the Type attribute.
  • This information can also be found in the ONET.XML file in the appropriate site template directory under C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates