Update 6/15/2012: See the comment at the bottom.
…well not really, but essentially I’ll be discussing how to create the functionality that does that. My self-assigned goal in this post is to enable SharePoint search to perform a text search of Project Center content – and – based on that search allow the user to navigate directly to the appropriate project record or PDP within Project Server.
I will be showing you how to do this using External Content Types (ECT) and then modifying the results with InfoPath to render a dynamic URL from the text based results of the ECT.
This is a request that I’ve run into a couple of times both on client sites and on the online forums. Generally, it’s driven by the fact that we have too many projects and it’s hard for someone to zero in on specifically the right project. Hence, the user would like to simply type in the name or a relevant keyword into SharePoint search and go directly to the record.
As alternatives, note that Project Center does offer a custom filter option, so I could go create a onetime filter that filters on specific text in the project name. In my experience, this is a bit slow and also the filter has to be removed and reset for the next project. The other solution would be to create custom views that slice and dice the portfolio and make it easier to navigate (see this post on creating a My Projects view). The functionality I’ll show you how to build today would augment that.
1) Reviewing the Requirements
Let’s start off by looking at how we will navigate to the PDPs when we finish this effort. If you click on a project in Project Center, you should see a PDP such as the Project Information page. Note that I am using the default Contoso demo image so my defualt page is actually the Proposal Workflow Status page.
Here’s Project Center – just to get us all on the same page….
…and the PDP….showing the current workflow status.
Take a look at the URL for the PDP….
In that URL, we can see the URL of Project Server: http://project.contoso.com/pwa/project%20detail%20pages….
….the actual PDP: proposalstagestatus.aspx…
….and the unique ID for the project: projuid=012441e0-573e-48f7-a518-1169c28fcde8
What we’ll do then is create an ECT and manipulate the results within InfoPath to regenerate that target URL.
2) Create an External Content Type
I won’t spend a whole lot of time talking about creating ECTs, but basically they’re a method of bringing external data (in this case Project Server data stored in SQL) into the SharePoint fold.
To support this example, I will create an ECT with four fields: Project Name, UID, Project Description and Project Keywords. I could, in theory, pull any field I wanted, which should then be subject to the SharePoint search indexing.
For more information on creating an ECT, I refer you to this post from last year. Note that we will not need a filter as part of the ReadList operation.
3) Create an External List
I now create a site to throw the list on. Nobody should actually have to navigate to the site. We simply want it to be appear within the search results. For this example, I am going to create a site called External under the BI Center. As this site will need to be modified with SharePoint Designer, we may need to move it off of the main PWA site – which has been set to preclude any SharePoint Designer edits.
On this site, I create an external list and point it at the ECT we just created.
So far, so good. Note that you can click on the project to show the default display form. Note that we could also add metrics to this form, i.e. other values that typically appear within Project Center.
Next, we’ll modify the display form so that it will display the URL of the project record within Project Center.
4) Modify the Display Form
Modifying the default display form for external lists is a relatively simple exercise – provided you know one workaround. I was able to find this in a blog post yesterday, although unfortunately, I didn’t make a note of which one. Anyway, it’s usually quite easy to modify display forms for SharePoint lists. All one has to do is click on the option in the Ribbon.
Unfortunately, that option doesn’t work in external lists. The trick here, is to click on the button in the ribbon to modify the list in SharePoint Designer.
Once the list is open in SharePoint Designer, select the option to modify the form in InfoPath.
This will launch InfoPath.
Now, let’s create a new field that will store the calculated URL. To do this, right click on MyFields in the Fields dialog box on the right and create a new field called URL. Set it as a hyperlink field type.
Drag the new field over to the form. I also tidied up the form a bit by removing the UniqueID and cleaning up some of the label names. I also converted the Description text box to a multiline display.
Now right click on the newly created field. We’re going to modify the default value to display the appropriate URL.
Select the Properties option, then the button to edit the default calculation.
Once there, I’ll add the following custom formula:
Hit Ok, and publish the form back up into the InfoPath list. You may have to save the template somewhere prior to publishing. It doesn’t matter where you save it.
5) Reviewing the Results
Let’s take a look at the results. To do that, navigate back to your external list. Refresh it for good measure. Click on one of the projects to review the results:
Click on the URL to confirm it navigates back to the appropriate place in Project Center.
You now have an extended version of the Project Center navigation structure accessible via enterprise search that allows users to easily find projects. You may want to investigate reconfiguring your search and perhaps adding a custom scope to hit the external list, but that’s a topic for another blog.