Archive for the 'Technical' Category

SharePoint 2010 content organiser – document routing workflows made easy

 A really powerful new feature in SharePoint 2010 is the content organiser, a suped-up version of the routing engine found in the SharePoint 2007 records centre.

There are a good many articles out there extolling the virtues of this flexible new feature which is great. In this post however, I want to concentrate on one very specific area: -

http://YourSiteName/_vti_bin/OfficialFile.asmx

 I know, I know, not catchy (or fun) and I know it’s not gonna get you out of bed on a wet London morning.

What it is going to do though, is be the url for the content organiser web service for that particular site collection.

Big wow!?

Whilst this might not seem like a massive deal, I’m sure you’re not lining it up to fill that elusive after dinner speaking slot, it does open up a few interesting possibilities – namely easy document routing workflow.

Now I know what you’re thinking, “hang on a minute…isn’t that what content organiser already does?”

Well yes, it handles document routing based on rules in a really slick way. It even has other elegancies such as evoking the routing engine when you update a document to a library that has rules pointing to it (see fig. 1 below)

This is really nice and very fast to configure. But what if you wanted to build in more complexity to how the documents are routed? Not so easy.

Back to that url and how it can help? Anyone who has looked at SharePoint Designer 2010 will know that things have moved on in leaps and bounds since the 2007 version and certainly where creating workflows is concerned.

The beauty of that url is that it can be referenced in workflows, meaning document routing can be achieved without having to worry about complex rule creation in SharePoint Designer.

So why would this be useful?

Take the example where you have an image library storing corporate images, but you need to be able to move items based on their status to a different location – where an image is marked archive or inactive for example.

Simply create a basic workflow in SharePoint designer and let the content organiser handle the complicated rule based and alerting functionality.

 SharePoint workflow

The advantage of this approach? Should it be decided at a later date to change where archived images are to be stored this can be easily handled by simply changing the ‘Target location’ in the organiser rules.

 Content organiser rules

No need to worry about setting up complex alerting rules in designer either, as this can be addressed in the content organiser settings, along with other useful functionality such as saving original audit logs and properties with the content wherever it lands.

 Great! Of course if your organisation doesn’t have particularly strict audit requirements but it would be really useful to know where the image has moved to and from (and who changed its status from archive to inactive for example), you could always look to expand on the variable outputs in the SharePoint Designer workflow…

SharePoint workflow output variable 

…and write these outputs to a ‘Multiple lines of text’ field that appends (version control required here of course).

Voila – a rudimentary audit trail of what your image has been up to while you’ve been away! If only it was that simple with cats…and children! (and stocks, and socks, and so on, and so on).

Have a play. Get creative. Enjoy.

Back to the PointBeyond web site

Build a Simple Language Translator using InfoPath and No Code – Part 1 of 2

One of the most useful features of InfoPath, is the ability to easily set up and use data connections from so many sources. Using data connections to web services, InfoPath can be used to create a form that passes data onto a third party website where the data is acted upon in some way and a response passed back to the end user.

A simple, yet practical example of this is this simple text translator. This was built on the back of a customer request to have forms available in multiple languages. No code is used in this development, but we do make use of the “Rules” functionality by which Business Logic and in-form workflow can be built.

While the result of some InfoPath experimentation presented here will not be putting any multi-lingual technical translating staff out of business I’m sure you can think of other applications which could benefit from a Web Service interface such as this.

Ok – so how do you go about creating a translation form? It’s as simple as baking a loaf of bread, so let’s start by looking at the ingredients we will need!

Recipe for InfoPath Translator – Serves 5 ( English, German, Spanish, French and Italian!)

Ingredients:

Instructions

  1. In InfoPath 2010 Designer create a new Blank Form and create a table with six rows and two columns
  2. Create a Data Connection – Not built one of these before? – Don’t worry a wizard makes this really simple!
    1. From the ribbon select Data / From Web Service /From SOAP Web Service and enter in the web service URL as below:

3.Now from the list of Services select Translate

4. On the next screen you will see a list of Parameters that are used by the web service – Enter your Bing Application ID here by using the Set Value button (You do have an app id don’t you? If not, sign up at http://www.bing.com/toolbox/bingdeveloper/) In the content type and category parameters set the values to ‘text/plain’ and ‘general’ respectively

5. The next screen should be skipped – hit the Next button

6. Now we are on the final screen for our data connection set up. Deselect the “Automatically retrieve data when form is opened” check box – Best practice for forms is to only use data connections when needed, and we will only be calling this service when a button is clicked

Build a Simple Language Translator using InfoPath and No Code – Part 2 of 2

7. After you have finished your data connection you will have two data references in your InfoPath project – Main and the Translate service you just created will be labelled a secondary connection…

You will see from the view above that the data connection is in two parts “query fields” and “data fields”. Put simply, the query fields enable you to pass information through the data connection and the data fields represent what you get back!

8. Enter text labels in the left hand column of the table you created in step 1 and drag the text field and the TranslateResult fields from the fields pane on the right into the form layout 

9. Now switch to the Main Data view in the fields pane and add two dropdown list controls and label LanguageFrom and LanguageTo… This will create two extra field references in the Myfields folder of the Main view of the Fields pane as in the screenshot below. These two fields will be used to provide data to the “From” and “To” query fields of the Translate data connection

10. Enter the values as in the screenshot below to the Drop Down List Box properties for the LanguageFrom field

11. And enter the values as in the screenshot below to set up the LanguageTo Dropdown List Box properties: Yes, pretty much identical to the LanguageFrom field!

For this example I have only added five languages and their associated codes , but you can add additional languages to these controls if they are supported by the Microsoft Translate API.

12. Now finally we just need to add a button to our form and attach some logic to the button so that when pressed the following will happen:

  • Populate the “From” query field of the Translate data connection with the value selected in the LanguageFrom Dropdown List
  • Populate the “To” query field of the Translate data connection with the value selected in the LanguageTo Dropdown List
  • Run the web service to see the translate result

This is achieved simply by adding a button from the Controls section of the Home ribbon and adding a Rule with three actions as below:

The three actions are

  1. Set a fields value (select the “from” field from the Translate data connection and make equal to the LanguageFrom field from the Main data connection)
  2. Set a fields value (select the “to” field from the Translate data connection and make equal to the LanguageTo field from the Main data connection)
  3. Query using a data connection (select the Translate data connection)

Conclusion

Well, that’s all there is to it! Test the form in preview mode and add some simple sentences and combinations of From and To languages. If you have been successful, you will appreciate how InfoPath can be used to address some fairly complex Business scenarios in a straightforward manner with NO CODE REQUIRED!
J

Do you have any similar examples of code free web service based InfoPath development – we’d love to hear from you!

I Love PointBeyond

Keep seeing these labels. Our fame is spreading!

Back to PointBeyond web site

Cascading Dropdowns in InfoPath 2010

This is a robust way to implement cascading (sometimes called nested) dropdowns in InfoPath 2010, that also works with InfoPath Forms Services in SharePoint 2010. The approach in this article expands upon the demo that I gave at SharePoint Saturday UK on 12 November 2011.

There are numerous other blog articles out there explaining how to achieve cascading dropdowns in InfoPath, and I have had varying degrees of success with them. Some work okay but are complex, others seem to be a bit buggy. So the approach I take here will (hopefully!) provide a good solution – but comments welcome as always!

Objective: On an InfoPath form I wish to have an arbitrary number of dropdowns. Selecting an item in the first dropdown determines the items available in the second, selecting an item in the second dropdown determines the items in the third, and so on. A user should be able to go back to a previous dropdown and make a change. Users should be forced to select in order, so that until an item in the first dropdown is chosen, the second dropdown is disabled, and so forth.

Preparing the Data Source

For the example below our data source for the dropdown items is SharePoint lists. However the method could be modified to use other data sources such as a database or a web service. In the dropdowns users will select a region, then an office, then a team.

I have created three lists for the example and will create three dropdowns.

The “Regions” list is a custom list with no extra columns added. It is populated as follows:

The “Offices” list is a custom list with one extra column added, which is a lookup to “Regions”. It is populated as follows:

The “Teams” list is a custom list with one extra column added, which is a lookup to “Offices”. It is populated as follows:

Designing the InfoPath 2010 Form

Launch InfoPath 2010 and create a new blank form (or open the form to which you wish to add your dropdowns).

Add three text fields as follows:

Repeat for “Office” and “Team”.

Now drag-and-drop each field onto the form.

Without any formatting your form will look like this:

Right-click each textbox and choose “Change Control > Drop-Down List Box”.

The form will now look like this:

Now we need to create three data sources, one for each dropdown.

Click on the “Data” menu at the top of the window, and then “From SharePoint List”.

We’ll do “Region” first.

Enter the location of the SharePoint site. Note that the lists can be on a different site to the site that our form is going to end up in.

Click “Next”. Select the “Regions” list.

Click “Next”. Select “Title” and change the sort order to “Title”.

Click “Next”. Click “Next” again on the offline option page.

Accept the options on the final page.

Click “Finish”.

Now repeat this process for Offices and Teams, but with the following two changes:

First, include the related column in the fields to select from. So for Offices the wizard will look as follows:

Teams will look similar, but with the “Office” column selected.

Second, uncheck the “Automatically retrieve data when the form is opened” option. For all but the first dropdown, we won’t be getting the data until the previous dropdown is changed.

Ok now we need to hook up our dropdowns to our data sources. Right click the “Region” dropdown and choose “Drop-Down List Box Properties”. In the “List box choices” section choose “Get choices from an external data source”. Make sure the data source is “Regions” and amend the “Display name” field to Title (using the button on to its right) so that the form looks as follows:

Click “OK” and repeat for the “Office” and “Team” dropdowns, choosing the appropriate data source in each case. Make sure the “Value” and “Display name” fields are always correct. So for “Office” the form looks as follows:

If you preview your form at this point then the “Region” dropdown should be populated but the other two should not.

Finally we need some rules to make it all work.

Select the “Region” dropdown, then on the “Home” tab at the top, choose “Manage Rules”.

On the “Region” dropdown we will add a single rule. Choose “New, Action”.

Change the “Details for” to read “Populate Offices”.

Now choose “Add, Set a field’s value”.

The field we will set is the “Region” field on the “Offices” data connection. This will act as a filter on the list of offices, only displaying those that have the correct region.

Click the button to the right of “Field”. Change the dropdown at the top to “Offices (Secondary)” and expand “queryFields” to select “Region”.

Click “OK”. Now click the “fx” button to the right of the “Value” field. Click “Insert Field or Group…”

Choose “Region”.

Click “OK”. The formula shows as follows:

Click “OK”.

Now add another action to the rule, again to “Set a field’s value”. This rule will simply set the “Office” field to blank, to clear out any old values.

Now add an action to “Query for data”.

Set the data connection to “Offices”. Click “OK”.

If you preview your form now you should be able to select a region and see the correct list of offices populated.

Now we set up the rules on the Offices dropdown. Select the dropdown and click on “Manage Rules”.

Add a new formatting rule:

Change the details to “Disable if Region Blank”. Click on “None” under “Condition. Set the condition as follows:

Select “Disable this control”.

Next add a new action rule.

Call this rule “Populate Teams”.

Add an action to set a field’s value.

Pick the Teams/Office query field.

Set the value equal to “Office”.

Add another action to set “Team” to blank.

Add a final action to query the teams data connection.

Finally add a formatting rule to the “Teams” dropdown. This rule will disable the control if “Office” is blank.

Now preview your form and check everything works!

Provided all is okay you can publish your form. If you want to use InfoPath Forms Services within SharePoint 2010, it should work fine.

Back to PointBeyond web site.

Set Logos on all SharePoint Sites in a Site Collection – PowerShell One-liner

One line of PowerShell to set all the site logos on SharePoint sites in a site collection – much quicker than setting them all by hand!

(get-spsite http://SiteCollectionURL).AllWebs | foreach {$_.SiteLogoUrl = “/path/to/your/logo.gif”; $_.Update()}

You’ve got to love PowerShell with SharePoint!

Back to PointBeyond web site

Error communicating with Excel Services Application – Events 5231 5239 5240 (SharePoint Server 2010)

I’ve seen this issue twice on production systems now, and have a solution that has worked in both cases. From http://technet.microsoft.com/en-us/library/ee513104.aspx

Symptoms: One or more of the following symptoms might appear:

  • Delayed load times for workbooks.
  • Workbooks fail to load.
  • This event appears in the event log: Event ID: 5231 Description: Unable to reach Excel Calculation Server <URL of machine> [Session: <session ID> User: <username>].
  • This event appears in the event log: Event ID: 5239 Description: There was an error in communicating with Excel Calculation Server <URL of machine> exception: <exception message> [Session: <session ID> User: <username>].
  • This event appears in the event log: Event ID: 5240 Description: There was an error in communicating with Excel Calculation Server <URL of machine> exception: <exception message> [Session: <session ID> User: <username>].

The Technet article somewhat unhelpfully suggests a reboot. I’ve tried that and it works for a while then fails again. However I have found the following to be effective:

  • Log on to the SharePoint server(s) using the service account that is running the Excel Services Service Application
  • Log off

It seems that this creates a user profile for the service application account, which fixed the problem for me straight away, without a reboot.

Microsoft Project 2010 – Scheduling on-going tasks

I was looking for the best way to schedule on-going tasks, for example ‘project management’, in a simple project plan. I came up with a number of different ways of accomplishing this but have chosen to implement the method below.

Let’s suppose there are 2 people involved on a project, both of which are involved on the standard tasks, but 1 of which is also responsible for project management for 20% of the project lifecycle, therefore only allowing 80% of their time to be spent on other tasks.

I created 2 standard resources Bob (who will also be the project manager) and John and changed the Units of Bob to be 80%.

I then created a third resource Bob PM and changed the Units value of that resource to be 20%. My Resource Sheet now looks as follows

Back to the plan. I entered the appropriate tasks with relevant Start Dates, Predecessors, and Work values. The project lasts 2 weeks as per the below schedule

I know the project starts on Mon 3rd and finishes on Friday 14th so now I just need to add in the project management activity. Bob has time available to fit in 20% project management time due to the setup of the resources earlier. I add in a project management task as a ‘hammock task’ as follows to cover the project life cycle. Copy the date from the Start cell of Task A, this is the start date of the project. Highlight the Start date for the project management task and select Paste ->Paste Special -> Paste Link from the Task tab in the ribbon and click OK. Now copy the date from the Finish cell of Task F which is the end date of the project. Highlight the Finish date for the project management task and select Paste -> Paste Special -> Paste Link from the Task tab again. I then allocate this task to the Bob PM resource and now there is 16hrs of Bob’s time allocated to project management activities covering the project time period.

As mentioned earlier there are numerous ways to accomplish this and the above method is simple and may not suit you and that are many factors to consider when managing larger scale projects with shared resources etc. Other options include creating different calendars with only a 20% working week and assigning the task to a specific calendar.
Back to the PointBeyond website

SharePoint UK User Group Meeting Southampton 22 September 2011: SharePoint in the Real World

A great turn out for last night’s meeting, and I was very impressed by the quality of our speakers – all of whom were from local organisations that make use of SharePoint, and not regular speakers. They gave a refreshing and sometimes surprising take on the use of SharePoint.

First up was Gareth from a large local law firm. Gareth covered the challenges of the decisions that they had to make when implementing a SharePoint proof of concept from a standing start. Interestingly, Gareth did not present the SharePoint “Industry” in a very positive light. His frustrations included:

  • Being harassed endlessly by marketing teams and recruitment agents
  • Consultants with no knowledge of SharePoint but using it to get a “foot in the door”
  • Vendors who “Put SharePoint at the start of the name, and a zero at the end of the price”
  • Consultants with no interest in providing knowledge transfer, only in getting as much work for themselves as possible

Next up was Jim from Regs4Ships. Jim provided a fascinating insight into the world of shipping and explained their solution of running SharePoint on ships. Data is replicated between ships and office over a satellite link, with only 1Mb available per ship per day, so efficient compression and replication is essential. Their solution makes use of Infonic Geo-Replicator to send deltas via email.

After a break for refreshments at the bar conveniently located right next to the lecture theatre, we were back in to hear Chris from Southampton University. Chris explained their large scale SharePoint implementation which is designed to support a user base of 35,000 and comprises three farms. Chris also explained and demo’d a self service portal, that allows users to provision their own site collections. Chris explained the challenges they had faced with claims based authentication and how they had overcome them.

The evening ended with the giveaway of some goodies kindly provided by Regs4Ships, Axceler, and Microsoft.

See you at the next one!

Ian

Sites and lists not updating from the Content Type Hub

The Content Type Hub (CTH) brings fantastic new functionality to SharePoint 2010, functionality that anyone who has delivered or administered SharePoint 2007 will have been crying out for and no doubt welcomed with open arms.

The CTH can be a complex beast with settings located in lots of different places; Central Administration, Site Collections, sub-sites and the CTH itself.

Chances are, by the time you get to using content types from the CTH in document libraries way down in the basement of your SharePoint site structures it’s been a long time since you set up the Managed Metadata Service and the Hub – or perhaps you are an Information Manager and didn’t set it up in the first place.

So my question is: Where would you start to look if your content types in sub-sites and lists refuse to update properly?

Now I’m presuming here that you have correctly published the offending content type in the Hub, have run the 2 timer jobs in Central Administration and that the Site Collection you are trying to push the content type to is consuming the CTH.

In fact, I’m assuming you have one or more content type from the hub on your consuming Site Collection and have added them to document libraries – but now you’ve decided you need a new column on one of the content types.

You go through the same process described above (publishing the content type in the Hub, running the CA timer jobs etc.) but when you come to check the document library there is no new column.

To reassure yourself that you’ve done everything correctly, you look at the content type gallery in the consuming Site Collection and can see the new column. Very strange!

You’d be forgiven for thinking “this must be a setting in the document library”, or perhaps you forgot to tick the ‘Update all content types inheriting from this type?’ check box in the ‘Update Sites and Lists’ section of the content type in the Hub.

So you check and you check to no avail. You may even have tried running some PowerShell scripts to force the update. Nothing!

So what to do?

Turns out it’s simply the way the Managed Metadata Service Connection has been set up.

There are four useful little tick boxes, which you’re only likely to see at the point you create the service, two of which have a huge effect on how the Content Type Hub functions.

To get to them go to Central Administration > Application Management > Manage Service Applications > Highlight the ‘Metadata Service Application Proxy’ (click anywhere but the title) > Select ‘Properties’ on the ribbon (see screen shot below).

This should bring up the ‘Edit Managed Metadata Service Connection’ window.

Here you can see the four options I was talking about.

The first two are firmly aimed at the Term Store, but the last two have a huge impact on the CTH functionality as I mentioned. The last one is clearly what we’re after so let’s tick that box!

You should now see your document libraries and lists updating from the CTH without a problem.

As you can see, this can be a difficult problem to track down because the Site Collections are getting the content type updates as they should be, just not in the lists – but as ever, there’s just one more check box!

Back to PointBeyond web site

Next Page »



Follow

Get every new post delivered to your Inbox.