CustomAction Link on Subsite Redirects to Parent Site—SharePoint 2007

I recently had a problem where a Custom Action link that we had added to a SharePoint subsite’s “Create” page was pointing to the relative URL of the parent site.  I discovered that it was because, without a “scope identifier” on the UrlAction element of the CustomAction, the relative URL will default to the root site of a site collection.  So, to fix the problem I added “~site” to the beginning of the URL as you can see here:

<CustomAction Id="CreateCustomPage" GroupId="WebPages"
     Location="Microsoft.SharePoint.Create" Sequence="400"
     Title="Page from Template" Description="Creates a branded page."
    
RequireSiteAdministrator="True"
     I
mageUrl="/_layouts/images/ltblnkpg.gif" >

 <UrlAction Url="~site/_layouts/CustomDirectory/CustomPage.aspx"/>

</CustomAction>

Without including the “~site” statement this will, apparently, default to the root of the site collection, which means your subsites will redirect back to the root site without it.  After adding this everything worked fine.  All of my subsites go to the proper relative URL of their own.

Andre Vala has a great blog post that discusses SharePoint Custom Actions in greater detail.  This blog also explains the other items that you can place at the beginning of the UrlAction’s URL besides ~site (i.e. ~sitecollection and others), and it helped me to figure this problem out fairly quickly.

Technorati Tags: ,,,,,,,,,

Windows Live Tags: WSS,MOSS,CustomAction,Subsite,Parent,SharePoint,Custom,Action,UrlAction,Microsoft


Adding Table Cell Borders to Empty Cells in a SharePoint DataFormWebPart

If you’ve ever used a DataFormWebPart in SharePoint Designer 2007 with a border on the table, then you may have run into the problem of empty table cells loading without borders.  This causes your table to look very strange in the browser.  Well, here is a fairly simple work around to fix the problem.  All you need to do is add a script block to the xslt in SharePoint Designer that will basically put a space inside all of the cells.  Since this forces the cells to not be empty, they will all render with borders.

Here is the script block and some quick screenshots to demonstrate how it works.

<script type="text/javascript">
    document.write("&amp;nbsp;");
</script>

Here is how the table will render without the script block if there are empty cells:

Add the script block inside of the td’s just after the xsl:value-of tags that contain the SharePoint field names that you have included in your DataFormWebPart:

Here is what the new page with blank cells should look like:

Technorati Tags: ,,,,,,,,,,,,

Windows Live Tags: WSS,MOSS,Table,Cell,Borders,SharePoint,DataFormWebPart,Designer,script,forces,Here,text,Cells


SharePoint 2007 site is Blank in Internet Explorer 8

I recently installed SharePoint Server 2007 on my Windows 7 64 bit development machine, and after setting up my first Web App and Site Collection my test site would not load in Internet Explorer 8 or in SharePoint Designer 2007, although it would work fine in Firefox.  Now the screen would load blank in IE8 after asking for authentication about 3 times.  In SPD2007, it would ask for authentication seemingly endlessly until I just hit cancel, and it would never load the site.

At first, after asking and searching around, I thought that the loopback issue with IE8 may have been causing the problem, but even after double checking everything in that area I still had the same issue.  Also, I wasn’t getting the 401.1 screen, as is usually the case with the loopback issue.  If you are having that problem, then you should check out this post

Finally, a colleague of mine, Phillip Wilkins, told me that he fixed the blank screen issue by enabling Windows Authentication in IIS.  That fixed it!  Thanks, Phillip.

Here are some quick instructions with screenshots to show you what I did:

  1. Open IIS Manager (I do this: Click Start, type "iis," and then click enter).
  2. Click on Authentication under the IIS section.
  3. If Windows Authentication is Disabled, then click on it and then click on Enable under the Actions menu on the right.  You should now see that Windows Auth is enabled, and hopefully this has fixed your problem.
     

Missing “Create or extend Web application” Link in SharePoint Central Administration

I recently did a clean install of Windows 7 64 bit on my development machine.  I used Bamboo Solutions’ WSS on Vista tool to install SharePoint Server 2007 on it; however, when I navigated to Central Administration there was no “Create or extend Web application Link” there.

Well, at first I thought it may be a permissions issue, but everything seemed to be in place there.  I also made sure to right-click Central Administration from the Start Menu to “Run as administrator,” but that didn’t fix it either.

Then I realized that I hadn’t installed Service Pack 2 for SharePoint Server.  Microsoft suggested that I install Service Pack 2 for WSS 3.0 first, which I did, and that fixed the issue.  Then I went ahead and installed The 2007 Microsoft Office Servers Service Pack 2, and everything is running great now.

Technorati Tags: ,,,,,,,,,,,,,,

Windows Live Tags: Create or extend Web Application,Service,WSS,MOSS,SharePoint,Central,Administration,Bamboo,Vista,Server,Pack,Microsoft,Office,Servers,Solutions


stsadm –o uninstall – Don’t do this!

Well, at the risk of sounding like a complete idiot, I’ve chosen to share my experience with you in order to help save you from some problems later.  I needed to force an uninstall of a feature from my development machine.  Well, this isn’t an stsadm command that I have had to use much, so I didn’t remember exactly what the command was.  The command is “uninstallfeature", by the way.  However, I was thinking that it was “uninstall”. 

So, at this point I thought I’d type in “stsadm –o uninstall” and hit enter so that it would tell me what arguments I needed to include, as you can see in the below screenshot with “addsolution".

 

Obviously, this isn’t the best practice for how to find the arguments for an stsadm command; however, I knew that it would work if I was missing any arguments (see “Important Note” below).,

The Big Problem

Now, here is the BIG problem.  Since I had the wrong command (“uninstall” instead of “uninstallfeature”), I got to enjoy a wonderful learning experience.  The stsadm command “uninstall” doesn’t have to have any arguments, so if you type it in and press enter, then it will just start to run.  And do you know what it does?  That’s right:  It uninstalls SharePoint from your machine WITHOUT asking for any confirmation.  Lesson learned.

Important Note

By the way, to avoid this problem altogether you should always do what I did not do: put “–help” after any command that you wish to see the parameters for.  For example: stsadm –o uninstall –help

Technorati Tags: ,,,,,,,
Windows Live Tags: moss,wss,feature,development,SharePoint,stsadm,uninstall,uninstallfeature


SharePoint Designer 2007 Workflows—KYSPUG

Thanks to everyone who attended my presentation on SharePoint Designer 2007 Workflows at the Kentucky SharePoint User Group last night.  We had a great turnout and had lots of great interaction.  I want to give a special thanks to Jeremy Sublett of Composable Systems and Greg Kamer of Mirazon for their selfless efforts in running this user group for us.

You can download the slide deck HERE

Here is a quick synopsis of the presentation:

  • What are Workflows?
  • Out of the Box WSS and MOSS Workflows
  • SharePoint Designer Workflows
    • The parts of a SPD WF
    • The ootb actions
    • The wf files that are created
    • The wf forms that are created
    • The browser screens for interaction with the wf
    • Common Problems, Issues, and Limitations

Thanks!

Technorati Tags: ,,,,,,,,,,,,,,,,

Windows Live Tags: SharePoint,Designer,Workflows,KYSPUG,Kentucky,User,Group,Jeremy,Sublett,Composable,Greg,Kamer,Mirazon,MOSS,Problems,Limitations,Systems


Windows Live OneCare Problem

Windows Security Center was showing me the following error when I woke up this morning along with my Malware Protection having a “yellow light” rather than green.

Windows live OneCare is on but is reporting its status to Windows Security Center in a format that is no longer supported.  Use the program’s automatic updating feature, or contact the program manufacturer for an updated version.

Thanks to Kevin Hau for His Post about a fix that has been released for this issue.  I have included the 32 bit and 64 bit links here as well.  This was a quick and simple fix that worked great.  As Kevin points out, you will need to download the exe and Run it as Administrator.

32 bit fix:
http://download.microsoft.com/download/E/F/4/EF4F2FE5-2E02-4DA1-8E68-3DC3035CEF52/WscGracePeriodFix32.exe

64 bit fix:
http://download.microsoft.com/download/E/F/4/EF4F2FE5-2E02-4DA1-8E68-3DC3035CEF52/WscGracePeriodFix64.exe

Technorati Tags: ,,,,,,,

Windows Live Tags: Live,OneCare,Problem,Center,error,Malware,Protection,status


TFS—Server has committed a protocol violation

This may seem like a no-brainer to some, but I beat my head against the wall for a while with it.  If you are trying to get the latest version from Team Foundation Server for a project, and you get an error stating that the Server has committed a protocol violation, it may be due to Windows Live Family Safety if you have it installed.  As soon as I turned Windows Live Family Safety off, I could get latest version with no errors.  I actually just decided to completely uninstall it.  I just wanted to try it out to see how it would work for my kids.  Moral of the story—Windows Live Family Safety is probably not a good idea on a development machine.


SharePoint Yes/No Column Problems

I have been dealing with some issues concerning the Yes/No column in SharePoint, and I ran across this blog post by John Ross.  He shares some good information in it, and he helped push me over the edge with the opinion that I was beginning to form about Yes/No columns—that you are better off just using a Choice column with the text values of “Yes” or “No” rather than an actual Yes/No column. 

Read John’s blog post to discover his reasons.  One of my main reasons is this:  You will have to deal with the values from these fields showing up as “True” and “False” if you want to display them through a SharePoint Designer Workflow (e.g. in an email).  If it is not acceptable to have them display as True/False, then you will have to add some more complex steps to your workflow that first test for what the value of your Yes/No column is and set a variable to the text of “Yes” or “No” based on what the value of your column is.  Then you will have to use this variable to display the value of your Yes/No column throughout the rest of the workflow.

By having to deal with these extra problems (mine and those that John points out), I am of the opinion that it is usually best to simply use a Choice column rather than a Yes/No column unless you have a legitimate business reason to have to use the Yes/No column.  Thanks for your insight, John.


Displaying SharePoint List Data in another Site

Can you display a SharePoint List from one site as a Web Part in another site?  Yes, you can.  There are third-party tools that you can buy to do this; however, this blog post will show you how to do it with the FREE SharePoint Designer 2007 tool.

  1. As you can see I have a parent site “Jason’s Site” with a subsite called “Subsite.”  I have created a Web Part page on the parent site that I will use to display list data from the subsite.
  2. First you will need to open the site that you want the data to be displayed on in SharePoint Designer, and make sure that the Data Source Library is showing by going to Data View > Manage Data Sources.  Then you click on Connect to another library…
     
  3. Next, you will go through the following series of screens to navigate to the site that contains the list that you want to display data from.  NOTE: In the Choose a Web Site dialog you will do just that: Choose a Web Site.  Be sure not to actually navigate to the list itself.  Highlight the Site and click Open.

  4. Now you should see the site you chose displayed in the Data Source Library pane.
  5. Next you will need to open up the page that you want to add the Web Part to.  In this case I’m using a page called “ToDisplaySubsiteList.aspx".
  6. Place your cursor just below the <ZoneTemplate> tag, and then add a Data Form Web Part to the page by going to Insert > SharePoint Controls > Data View.  This adds a <WebPartPages:DataFormWebPart> to the page.
  7. Now, with the newly added Data Form Web Part highlighted in the Design screen (it is highlighted by default after being added to the page), drill down to the list that you want to display in the secondary site’s directory in the Data Source Library, click on the drop down menu for the list, and click on Show Data.
  8. Hold down the Ctrl button and click on each field that you want to display in the Web Part.  I’ve selected the first two fields in the screenshot below—“Title” and “Subsite.”  Then click on the drop down Insert Selected Fields as… and choose either Single or Multiple Item View.  I’m choosing multiple item view for this demonstration.
  9. Now your list data from one site will be displayed on another site through a Data Form Web Part.  You can use the Common Data View Tasks window, highlighted below, to fine tune how the Web Part behaves.  I am not getting into the details of how to do that in this post, but I will point out that you can do things like Filter, Sort and Group, set Paging options, and set Parameters for the Web Part (e.g. you can set a Query String Parameter for the Web Part to control what item will be displayed if you chose Single Item View.).
  10. Here is the page loaded in the browser.  We are in the Parent Site displaying list data in a Web Part from a subsite.  IMPORTANT NOTE:  You will need to be sure that individuals that you intend to display this data to on this site have permissions to view the data on the subsite, or the data will simply not appear.

Follow

Get every new post delivered to your Inbox.