Archive for the ‘Training’ Category

Free SharePoint 2013 training for End Users

Date:January 7th, 2016 Author: Tags: ,
Category: Community, Training Comments:0 ;

It’s a common problem when IT systems are implemented that we give little thought to End Users and they are expected to just ‘figure it out as you go along’.

I think it’s particularly acute for software like SharePoint as it’s a huge, complex product and can be used in so many different ways.

There is a huge amount of information available for Developers, Administrators and Power Users – but surprisingly little aimed at End Users.

So to help we’ve partnered with ClipTraining.com – one of the leading providers of online training videos for software products – to bring you a totally free training course for SharePoint 2013.

clip-training-logo-small

We were particularly impressed with ClipTraining’s approach of breaking down each course into short to-the-point task based videos – this allows you to work through the whole syllabus or jump into specific areas when you ‘just need to get something done’.

Free? What’s the catch?

None!

You have to register by the end of March – you can then use the online training as much as you want until the end of 2016.

Pentalogic and ClipTraining will receive your registration details but we are committed to treating you fairly. We won’t rent, sell or disclose this to anyone else and we will not bombard you with emails!

Register Now!

Help us spread the word!

If you think this is useful then please help us spread the word.

  • How about that colleague who is new to SharePoint?
  • Tweet to your followers.
  • Someone asking a question in a forum who needs a helping hand?

About ClipTraining

ClipTraining’s eLearning library includes training videos for the full Office suite (Excel, Word, Outlook, PowerPoint, Access, OneNote, Publisher, Visio) as well as Windows 10, Skype for Business, Yammer and OneDrive.

Everyone is sure to learn something new about the tool they use every day – increasing productivity and saving hours of work.

Included are ClipTraining’s convenient administrative tools to track user activity, and easily organize and manage your entire team’s learning.

Purchase for individuals for just pennies a day – or get access for your whole organisation to slash your training and helpdesk budgets.

SPBiz – SharePoint conference for Business and Power Users!

Date:June 9th, 2015 Author: Tags: , , , ,
Category: SharePoint Ideas, SharePoint Online / 365 / Cloud, Training Comments:3 ;

As with any technology a successfully SharePoint implementation relies just as much on the business and ‘softer’ user adoption skills as the technical aspects. Which is why I’ve always found it strange that there are huge amounts of great technical resources (books, examples, best-practices, blogs, conferences etc) but far less aimed at business and power users.

The free on-line SPBiz conference is going to balance this a little with its focus on the needs of SharePoint Business and Power Users. There is still some great technical content in there but the focus is on empowering the less technical audience with resources to get things done and make SharePoint a success.

Just some of the sessions at SPBiz!

  • Create a GTD Dashboard in Office 365 to “Get Things Done”
  • Want to use SharePoint for internal communications?
  • Secrets of Successful SharePoint Intranets
  • How to build a knowledge sharing culture
  • Strategies to Deliver Successful Employee Portals
  • Leverage SharePoint 2013 for Better Collaborative Project Management
  • How to be productive with Office 365
  • Change business processes into easy SharePoint workflows
  • Find out about the best “no-code” solutions for SharePoint
  • SharePoint Governance 101

June 17th and 18th – Free and Online.

Register Today for free or browse the Agenda for Wednesday 17th and Thursday 18th.

SPBiz-MastHead

Free online SharePoint conference – SP24

Date:January 24th, 2014 Author: Tags:
Category: Community, SharePoint Ideas, Training Comments:0 ;

The team over at SharePoint-Community.net are organising their first on-line conference - SP24.

It runs on Wednesday 16th April, 2014 from 10pm GMT for 24 hours.

There are two tracks – Business and Technical focused and each track has one session per hour. There are some great speakers lined up already and more being voted in by the community.

Its totally free to attend - just hop on over and register.

Key Facts

  • Free for all attendees.
  • It’s entirely on-line – so you won’t need to leave the office or home!
  • Takes place on 16th April 10pm GMT.
  • Lasts for 24 hours.
  • Famous speakers from all over the world.
  • Keynote from Bill Baer (Senior Product Manager, Microsoft).
  • Comprises of 2 tracks, (business and technical).
  • 48 Live sessions + on-demand sessions.

Find out more and register at https://www.sp24conf.com/

How to learn SharePoint

Date:January 24th, 2013 Author: Tags:
Category: General, Training Comments:0 ;

SharePoint is a HUGE product. Add to that the Microsoft upgrade treadmill (e.g. SharePoint 2013) and even though I’ve been working with it for nearly 8 years now I am still finding new things.

Perhaps the most common question you see in forums (StackExchange, Microsoft Community Groups, Linked In groups or plenty of other places is “How do I learn SharePoint?”. And this isn’t just restricted to Developers – its power users, end users and everyone else in the spectrum. And its not just individuals – as Veronique eloquently points out – many companies install SharePoint and then… then… wonder “We’ve got SharePoint, Now What?”.

So where do you start? Some would argue that depends if you’re a developer, power users, user or admin – and whilst that’s true to some extent if you’re a developer you really need a good grounding otherwise you will spend days recreating something that’s already built in if only you knew it existed! If you’re an administrator how are you going to set policies for something you don’t know inside-out?

Mark at Collaboris has put together some lists of resources using that you can vote on using a cool service called list.ly. As votes are cast the best content should surface to the top – How to learn SharePoint and where to get training.

In addition to that if you’re a developer you obviously need to start with a solid grounding in ASP.NET. After that you are not short of places to start but two that spring to mind are Bjorns (who never afraid to be opinionated!) – What is a SharePoint developer post and Stuarts 10 things developers should know about SharePoint

Check out this list of SharePoint resources and vote for your favourites!

SharePoint Datasheet FAQ

Date:October 5th, 2012 Author: Tags: , ,
Category: General, Training Comments:3 ;

faqSharePoint’s datasheet is a powerful tool and a source of much trouble: This article is a quick summary of the common problems and their solutions, where possible.

Unfortunately there is rather a lot that is not possible; the datasheet is not like any other part of SharePoint, as it’s produced by an entirely different method. As James Love explains:

Customisations to the Data Sheet View are not supported, as this is generated using the Microsoft Office Access Web Datasheet Component, which renders the grid using the same base engine as the data sheet view that Microsoft Access uses.

So for the vast majority of questions, the answer is simply:

No

This is a list of the common scenarios that are not possible via the datasheet view. Click the numbered links for example questions (and further information):

Can I modify the datasheet using JavaScript/jQuery? [1] [2]

No. The datasheet is not rendered as HTML, so it can’t be edited via JavaScript.

Can I apply Conditional Formatting to the datasheet? [1] [2] [3]

No. The datasheet is not rendered via XSL, so Designer can’t be used to change its rendering.

Can I make my cascading lookup work with the datasheet? [1] [2] [3] [4] [5]

No. Editing Custom Field Types is simply not supported in the datasheet:

In SharePoint Foundation, columns based on custom field types are read-only in Datasheet view.

Can I wrap the datasheet column headings onto a second row? [1] [2]

No. To quote Mr. Hammer: "Can’t touch this."

Can I use the datasheet view with BCS (e.g. External Lists)? [1] [2] [3] [4] [5]

No. The datasheet view is only configured for displaying SharePoint data and sees through the the SharePoint-like veneer provided by BCS.

Can I use the datasheet in Chrome/FireFox/Safari/64-bit IE? [1] [2] [3]

No. The datasheet requires the use of ActiveX controls: These are only only available on 32-bit versions of Internet Explorer.

Yes

Surprisingly, there are many problems with the datasheet that can be solved:

Can I add the datasheet to a different page? [1] [2]

Yes. Simply add a List View Web Part to the page, and edit it to display a view on the list that’s set to show the datasheet by default.

Can set the datasheet to only allow editing (not adding/deleting items)? [1] [2]

Yes. Edit the users’ list permissions so that they only have access to Edit and View Items.

Can I fix the error "The selected cells are read only"? [1] [2]

Mostly. Here are three possible causes of this:

  • Multiline rich-text fields: Switch them to plain text to edit
  • Approval is enabled: Disable it
  • Metadata fields: Not supported

So this isn’t a very good "Yes", but at least there are workarounds for most of the problems.

Why can’t I open the datasheet view? [1] [2] [3]

This appears to usually be caused by having 64-bit Office installed on the client machine. It can apparently fixed by installing the 2007 Office System Driver: Data Connectivity Components according to KB 2266203.

Interestingly, if you happen to not have Office at all (because you’re on a server, or writing an article on your home laptop) you may need to install the Microsoft Access 2010 Runtime instead.

Can I completely rewrite the datasheet view? [1]

Apparently yes (see linked question), although I’m not sure you’d want to.

SharePoint Sandbox Solutions: The Good, The Bad, and The Ugly

Date:July 11th, 2012 Author: Tags: , , , ,
Category: General, SharePoint Development, SharePoint webparts, Training Comments:3 ;

Sandbox solutions are often seen as the cure-all for the worries of installing in-house or third party software on your SharePoint farm; but all is not as it seems.

This article aims to dispel some of the illusions around the safety of Sandbox Solutions, and cut through some of the fluff about what the sandbox should actually be used for and why.

  • The Good: What sandbox solutions do well
  • The Bad: What sandbox solutions don’t protect you from
  • The Ugly: The compromises you have to make to use them

What is a Sandbox Solution?

A Sandbox Solution is just like a normal Farm solution, except that it is deployed to a specific Site Collection (rather than the whole Farm), and has a limited set of tools it can use.

A full listing of what you can and can’t do in the sandbox can be found here:

Sandbox Solution Considerations (section “Capabilities and Elements in Sandboxed Solutions”)
Restrictions on Sandboxed Solutions in SharePoint 2010

It’s just like having a toddler in a sandbox in your garden (or yard): They can build sandcastles and dig holes using the tools you give them, but they can’t play with the chainsaw or ride-on mower you’ve left lying around (or dig enormous holes in your flower beds).

The Good

Sandbox Solutions are prevented from doing many things that could cause security or performance issues on your SharePoint server. Notable restrictions include:

  • No access to the network(s) your server is connected to
  • No access to the server’s registry
  • No access to the server’s filesystem
  • No access to e-mail via SMTP
  • Permissions cannot be elevated

There are also some additional features to help keep solutions in line:

  • Solutions can be installed at the Site Collection level by Site Collection administrators.
  • Resource Usage Limits are applied to solutions and can be monitored and limited by the administrator, preventing faulty or processor-hungry code from overwhelming the server.
  • Solutions can be automatically validated, and known troublemakers can be banned from the entire farm.

Notably, the main benefit to the Site Collection administrator is the ability to deploy their own solutions, but the majority of the other benefits are to the Farm administrator (and/or hosting company); although everyone benefits from the improved system stability these features help to ensure.

The Bad

There are a great many features to help with system stability and the prevention of security breaches; but there are limits to what the solutions are prevented from doing.

You should certainly never deploy untested third-party solutions to the sandbox “without fear of bringing down the entire farm”.

The best example of a danger to stability from within the sandbox is the lack of control over the Client Object Model, mentioned here: Sandboxed Solutions in SharePoint 2010

Pages, Web Parts, and controls that are deployed in sandboxed solutions can include code that runs against one of the SharePoint Foundation client-side object models … Code that runs on the client computer is not subject to any of the code execution or resource usage restrictions.

For example, a solution could contain malicious or badly written code executed via COM that requested all the items in a list an infinite number of times. If embedded into a web part, this would effectively turn the computer of every user that viewed it into a node of a DDoS attack on the server farm.

Rather less dramatically, it’s worth noting that there are no specific restrictions on actively malicious code within a Site Collection. It’s perfectly possible to:

  • Delete sites and sub-sites
  • Add COM calls to export data to an external site (much like Wictor’s data import)
  • Copy data added/edited in lists with item-levels permissions to unrestricted lists

The Ugly

Although sandboxing adds restrictions at every level of SharePoint, the feature wasn’t in the original platform design (in SharePoint 2007). In order to squeeze this feature in, some sacrifices had to be made.

Since there’s no access to the filesystem, the following aren’t possible:

  • Application Pages
  • Visual Web Parts (since they deploy a Control Template)

There are a some compromises due to Split Page Rendering; where sandboxed web parts are rendered separately from the rest of the page in a controlled thread:

  • No Script Manager to output/organise JavaScript
  • No web part connections
  • No access to the page Cache

Similar to the above: Because sandbox solution code needs to run in a controlled thread, the following functionality (that uses separate threads) had to be removed:

  • Workflows containing code
  • Timer jobs

Although most of these compromises are understandable, there are some features that are missing for no apparent reason:

  • You cannot use any of SharePoint’s own web controls (e.g. Date picker, User selection)
  • You cannot hide Custom Actions, or add Custom Action Groups

Conclusion

Sandboxing makes it less likely that you’ll accidentally destabilize a SharePoint farm with broken code, and make it easier to find and deal with trouble making solutions.

It’s also more difficult for malicious code to gain access to anything outside the Site Collection it’s deployed to, and slightly more difficult to destabilize the farm.

However, it doesn’t guarantee safety from either bad or malicious code and there are a large number of compromises to consider. Working around sandbox limitations will add overheads to most development projects, and many solutions will simply not fit into the sandbox model.

For example: FilterPoint and Highlighter are two of our own products that can never be made sandboxable, as they’re based on features that are simply not available in the sandbox.

Edit: Since the publishing of this post, we’ve discovered that sandbox solutions are now deprecated in SharePoint 15; as mentioned in the article SharePoint 2013 preview – Apps or Crapps?.

10 things developers should know about SharePoint

Date:May 4th, 2012 Author: Tags: , , , ,
Category: Community, General, SharePoint Development, Training Comments:1 ;

Many developers walk into the world of SharePoint unaware of the strange and interesting journey of discovery they’re about to begin.

It’s often difficult to know where to being, so here’s the top 10 most useful things I’ve learned since I joined Pentalogic back in 2010.

Pitfalls

1. Know your Editions
2. Don’t even look at the database
3. Get to know the front-end
4. Dispose of your disposables

Building your Knowledge

5. Learn the language
6. Get a good book
7. Love the MSDN documentation
8. Find a SharePoint community that suits you

General advice

9. Learn to live with CAML
10. Remember that SharePoint is enormous
Conclusion


1. Know your Editions

SharePoint comes in many flavours, each of which has it’s own features and shortcomings. Here’s a quick run down of the notable versions:

Release Cheap Expensive MS Hosted
2007 WSS3 MOSS BPOS
2010 Foundation Standard/Enterprise SharePoint Online
/ Office 365

It’s useful to get to know these for when you’re searching for solutions, as you’ll sometimes come across those that are edition specific (e.g. the Standard Edition’s ContentIterator class for querying large lists).

There are few things more frustrating than finding the perfect solution, and then discovering you have the wrong Edition.


2. Don’t even look at the database

To those new to SharePoint this is entirely baffling: Why wouldn’t you want to get data from the database? There are two good reasons for this:

a) Microsoft is very touchy about their database. They will not support any installation with software on it that modifies the SharePoint database.

b) The structure will give you nightmares. At some point in almost every database developer’s career they say: “Why don’t we abstract the table structure, and just have one massive generic table of text data?”

They’re then hit in the head by whatever small throwable object happened to be nearby, and their colleagues point out that although it would be very flexible, it would also be fantastically slow and unwieldy.

Unfortunately either the SharePoint team operated a clean desk policy, or they put an extraordinary value on flexibility, and the result is lurking in the darkness of the SharePoint database.


3. Get to know the front-end

It’s very tempting to dive straight into the code side of things, but when you’re trying to orientate yourself in the API it helps to have a good understanding of what you’re looking at from the front-end.

It’ll also give you a good feel for the site’s design, and hence what sort of layout the users will expect to see.

Many of the actions you perform in code will correlate to actions in the front-end, as well as the structure.

For example, to find a particular list’s view in the front-end, you would:

  • Open the site using the URL
  • Open the sub site
  • Select the list
  • Select the view

The code version of which is very similar in structure and information needed:

    using (SPSite site = new SPSite(http://site))
     {
         using (SPWeb web = site.OpenWeb("subsite"))
         {
             SPList list = web.Lists["List name"];
             SPView view = list.Views["View name"];
         }
     }

4. Dispose of your disposables

Some SharePoint objects (in particular SPWeb and SPSite) won’t automatically dispose of themselves when they’re no longer used. If you’re unaware of this, then you may easily run into post-deployment problems caused by the ensuing memory leaks.

The code in the previous section shows one method of dealing with this problem, and here is Microsoft’s advice on the subject: Disposing Objects

Interestingly, you shouldn’t always dispose of these objects; for example you shouldn’t dispose of  SPContext.Current.Web. As a general rule of thumb:

If you made it, dispose of it. If you were given it, leave it.

5. Learn the language

There is a huge amount of SharePoint-specific terminology, and some of it can be inconsistent and often misleading. For example, a Site Collection is an SPSite object, but a Site is an SPWeb object.

Another example that caught me off guard at first was that there’s a difference between the Object Model (the server-side SharePoint API) and the Client Object Model (client-side API). Whereas I was under the impression that one was an abbreviated form of the other.

Microsoft has published an enormous glossary, which seems to cover quite a lot of it: Glossary for SharePoint 2010. Although as with any jargon or language, most of it is learned along the way.

6. Get a good book

A good reference guide is infinitely more useful than an enormous glossary when getting to know the components of SharePoint. It’s vitally important that you get an overview of all of these components, to avoid inadvertently reinventing the wheel.

There are two I can personally recommend (having read them both cover-to-cover):

Building the SharePoint User Experience (Furuknap): Written for 2007, but still covers the mainstay of SharePoint. An easy and interesting read: If you’re quickly bored by dry textbooks, then this is definitely the book for you.

Inside Microsoft SharePoint 2010 (Various): A good follow-on from Furuknap’s book. A solid foundation of 2010 knowledge, and a good one to refer to now and again. Don’t start with this book though, or you’ll find yourself climbing a pretty steep cliff.

As your SharePoint knowledge grows, revisiting the books can also be quite useful. Parts you may have glossed over previously will suddenly start to make more sense, and you may find some useful tips you missed first time.

7. Love the MSDN documentation

Having developed and worked with a great many third party APIs and interfaces in the past, I can say with considerable confidence that the MSDN documentation is phenomenal.

Every class, method, and property is documented. Even the most obscure properties have at least a placeholder page, which in itself offers more information than many specifications. On top of this is the community comments on each page add clarification and often links to useful related articles.

However, there are two minor shortcomings. The first is that the background documentation (such as “Disposing Objects” mentioned above) is usually painfully boring to read and often skims around subjects rather than getting to the point.

The second is that the CAML documentation is very bizarrely structured: Elements used for almost completed different things share the same page just because they have the same name. There is also missing documentation where the CAML is more obscure, such as the elements used in SPWeb.ProcessBatchData().

8. Find a SharePoint community that suits you

Sometimes no amount of Googling or searching of MSDN’s documentation will find you the answer to the problem that’s been bugging you. In these circumstances it’s good to have a community of like-minded SharePoint developers to help you with your problem.

Being an active member of a community will also help you to expand your knowledge of SharePoint in general.

Here are a couple of the more notable SharePoint developer-friendly communities:

I’ve previously discussed the differences between the two in the following article: SharePoint Questions: MSDN versus Stack Exchange

9. Learn to live with CAML

Collaborative Application Markup Language (CAML) is another example where flexibility seemed to take precedence over usability. In certain circumstances you’ll be forced to write unserializable and poorly validated XML to perform seemingly simple tasks, such as importing comparatively small quantities of data (a few thousand rows).

However, it isn’t all bad: As I mentioned, CAML does allow a great deal of flexibility, and also has very easily readable syntax. The core resource for CAML can be found here: Collaborative Application Markup Language Core Schemas

When querying data you can avoid CAML by using LINQ, which is reputedly faster and easier to use. If you have no fear of CAML (or are working on 2007), the following tool may be of use to you: U2U CAML Query Builder

P.S. While we’re talking about tools, I should mention the extensive and impressive list of SharePoint development tools found here: List of SharePoint 2007 development tools

10. Remember that SharePoint is enormous

It’s important to bear in mind that SharePoint is a mind bogglingly large framework, with dark corners that even the SharePoint Development Team themselves haven’t visited in years.

This is important because occasionally you’ll find an area that’s poorly documented or has strange known issues, and it helps to have a little perspective on the scale of the system you’re dealing with.

You also need to be aware that there’s an awful lot you don’t know, and some of which you may never know. Getting a good overview of the components is essential. I wouldn’t recommend designing a project to use a component (such as a Custom Field Type or Site Template) until you’ve at least made a prototype in that area; to appreciate the depth of what you’re tackling.

The variety of customizable components in SharePoint also means that there is almost always more than one solution to a problem, as you can see in some of my previous posts: How to do list highlighting in SharePoint

Conclusion

The first challenge in SharePoint is discovering the existence of all the things you don’t understand yet. Once you’ve got a vague idea of all the different components, then you can really start to learn what each is about.

To borrow Mr Rumsfeld’s turn of phrase: Once all your unknown unknowns are known unknowns, you can start learning known knowns.

How not to develop a SharePoint [Today] Calculated column

Date:August 22nd, 2011 Author: Tags: , ,
Category: Calculated Columns, Highlighter, Training Comments:4 ;

After developing SharePoint Highlighter, we seriously considered expanding on this area with a Calculated Column that would allow you to use [Today] in the formula. If you’re thinking “But you can already!” I suggest looking at Ryan’s article about the [Today] column trick.

Needless to say, this would be a very useful tool for almost any SharePoint user. After much researching and prototyping we came to an unfortunate conclusion: Although it was possible to make a Custom Field Type to do this, it was almost certainly impractical (certainly for us).

The avenues we investigated finished in three types of dead-end:

  • Brick wall: A completely impassable system limitation.
  • Overgrown with brambles: Nothing but pain for all involved.
  • Swamps: A long unpleasant slog, with an uncertain outcome.

The Brick Wall

The first thought in any developer’s mind when making a variation on a class should be “Inherit it”. It allows you to take advantage of the existing class’ methods with minimal difficulty and yet offers (almost) total control over its behaviour.

Attempting to do so will reward you with the slightly misleading error:

The type ‘Microsoft.SharePoint.SPFieldCalculated’ has no constructors defined

A brief search in the MSDN documentation for SPFieldCalculated shows that the absence of public constructors is intentional:

Windows SharePoint Services 3.0 does not support inheriting from this class.

And so this avenue ended in a brick wall. More worryingly; disallowing the inheritance of a class is usually a sign that something so heinous is happening inside that Microsoft doesn’t want it reproduced.

Brambles

Intrigued by the promise of horrifying creatures dwelling within, I had a look inside the class to see what was happening (using my own powers of code intuition, and not any kind of questionable reverse engineering method).

It seems the actual calculations take place outside of the SPFieldCalculated class, using instead a call to SPRequest. This new lane of research quickly ended in spiky brambles, as using a direct call to SPRequest would make our product (and hence anything it’s installed on) unsupported by Microsoft.

Undeterred, I took inspiration from the billing system at my old work and looked at keeping the ‘black box of calculation mystery’ class running in the background, with the new class acting as a wrapper around it.

Creating a Custom Field Type that kept a hidden field for data storage in the background was an architecture we’d experimented with when creating Highlighter, so adding a relatively minor call to update the formula with the current date and time seemed quite easy.

The thorny ending in this case was the enormous potential server load; updating the formula every time the list was viewed (to keep it up to date) caused the entire list’s worth of calculations to be refreshed. Viewing just 20 items would make up to 5000 items recalculate their values for each of our columns on the view.

Swamps

The final and most desperate option was to do it ourselves: Completely rewrite all or a subset of the calculated column functions, and handle the associated function nesting.

I’m DIM: Doin’ It M’self.

Following this path would mean wading through the boggy and unpleasant process of exactly reproducing Microsoft’s function calls; avoiding the murky bottomless pools of performance issues. All the while hoping we wouldn’t run into any of the hungry and sharp-toothed show stoppers along the way.

As you may have guessed, we didn’t venture down this path.

Why are you telling me all this?

Because although these paths aren’t available to us as an ISV, it doesn’t mean they aren’t options to you (except the brick wall, of course).

Brambles: Using SPRequest is unsupported, but if this doesn’t deter you then this is still very much an option. Similarly, if you have an abundance of processing power (or really need a space heater in your server room) performing complete column recalculations on every view shouldn’t bother you.

Swamps: If you have very specific requirements you could get away with only recoding a few functions, which would greatly reduce the chances of you disappearing forever. Alternatively, if you have a large herd of idle developers you could set about recreating the whole set. However, I doubt this is a serious option for anyone except the head of the Microsoft Silverlight team.

How to create a Countdown in a SharePoint list

Date:May 17th, 2011 Author: Tags: , , , , ,
Category: Highlighter, SharePoint Development, SharePoint Free Tools, Training Comments:0 ;

countdown

If you’ve got a list containing important dates (such as the above example), it’s very useful to be able to easily see how long is left before that date, or how long since it has passed. Unfortunately basing a calculated column on the current date isn’t supported by SharePoint natively, as discussed in my previous article: How to use [Today] in a SharePoint list

So how can we work around this shortcoming without having to wave signs and shout outside Microsoft’s offices? The are a few options available to us:

  • JavaScript: Use a Content Editor Web Part.
  • Designer: Create a custom view in SharePoint Designer.
  • Code: Make your own custom field type from scratch.
  • SharePoint Highlighter: Buy our custom field type.

JavaScript document_into83

Since SharePoint is so uncooperative about using the current date on the server side (i.e. with a calculated column), we can wait until the information gets to our browser and fix it there with JavaScript.

We can get JavaScript onto a page using a Content Editor Web Part, which is added just like any other web part. Christophe at Path to SharePoint has put together a script that displays the date difference on hover, that can be modified slightly to display just the countdown: Countdowns – A second method

Adding a CEWP to each page your list is displayed on can become quite arduous if it’s displayed in a lot of places. In addition to this, information in a CEWP is quite vulnerable to accidental edits, as they are accessible to any user that can edit page content.

Designer designer3013

SharePoint Designer is a free and powerful tool from Microsoft for customizing SharePoint. Unfortunately, because it can do so much, its use is often frowned upon by site administrators (and sometimes even banned).

If you’re lucky enough to be allowed to use it, then (in an unusual twist) Christophe may once again be the person to look to. In a break from his many and various JavaScript solutions he’s put together a Designer solution for this problem too: A countdown for tasks lists

As with the JavaScript solution above, the Designer changes will have to be made on each view web part you want to see the countdown on, but fortunately the changes can only be overridden by someone else using Designer, or an administrator.

Code studio63

If you already have the backbone of a custom field type coded, then adding the XSLT to display this in 2010 should be reasonably straightforward. Alternatively this can be done within the custom field type class.

If you’re using 2007, then CAML rendering unfortunately fails you here, and it’s necessary to use a JavaScript workaround in one form or another.

Creating a custom field type from scratch for this sole purpose is probably going to be remarkably costly (in terms of time). Actually making the foundations of a custom field type is a bit of an investment, but thankfully Microsoft has put together a walkthrough to at least help you get started.

The benefit of using this method is that columns created from a field type are displayed on every page without having to add any additional code to the page itself.

SharePoint Highlighter currency_dollar43

Of course, it is possible to get all the benefits of a custom field type with much less pain: Buy a commercial solution.

If you have a glance at out handy product comparison, you can see the wealth of products we managed to find that offer this functionality. So far that grand total is… One: SharePoint Highlighter.

So if you’re looking for a commercial solution it looks like we’re the only option. If you know otherwise then please do tell us; but for the time being we’ll cheerfully carry on being the front-runner in this one horse race.

How to use [Today] in a SharePoint list

Date:May 12th, 2011 Author: Tags: , , , , , ,
Category: Calculated Columns, Highlighter, SharePoint Development, Training Comments:0 ;

today

Quite frequently we see questions about using the current date to display messages on a list when a date or time is (or will soon be) overdue. Most of these queries are from frustrated users who are trying to use [Today] in a calculated column, but find it missing.

I’ll quickly outline why this option is missing from calculated columns, and hence why the notorious [Today] trick is quite so controversial. But most importantly, I’ll run you through ways to actually display the information you want.

Why is [Today] missing from calculated columns?

When we look at a SharePoint list, the vast majority of us are instantly reminded of Excel (or Grandfather Excel, if you prefer). Because of this we quite reasonably expect it to act like Excel, and hence expect it to reconsider every formula and data item on the page each time we view it.

Unfortunately because of the much larger amount of information SharePoint has to pass back and forth, it takes a different approach to updating the data items. It will only update calculated values when the related item is added or edited.

Consider SharePoint as an overworked secretary; if you ask for a file to be updated they’ll find it in the filing cabinet, update the information, and correct anything else that’s awry on the paperwork while they’re there. If you ask for all the files for people named “Smith” to be put on your desk, unless you specifically say “And update the information on every single one while you’re at it”, it’s not likely they’ll do the extra work for no reason.

Because of this change in records-keeping, Microsoft had to skip functionality that would make this lower-maintenance updating method obvious. Since having a [Today] option would cause unedited items to go out of date every day, they had to leave it out. The [Me] option was another casualty, as it would require checking the current user every time the data was displayed.

So how do we get our files updated without further flustering our imaginary secretary? There are several options:

  • JavaScript: Use a Content Editor Web Part. Also known as “Do it yourself.”.
  • Designer: Create a custom view in SharePoint Designer. “Ask the secretary really nicely”.
  • Code: Make your own custom field type from scratch. “Get your own team to do it”.
  • SharePoint Highlighter: Our own solution to the problem. “Hire an extra secretary”.

JavaScript document_into8

Of course there’s always a JavaScript solution, and this one in particular from Paul Grenier uses jQuery to help with the process. This will mean adding the jQuery libraries to your site, and it’s also necessary to add a Content Editor Web Part to each page you want the feature to work on.

A little JavaScript knowledge will probably be necessary to make it fit your requirements, and as with any code tweaking, the more you know the better the result will be.

Designer designer30

SharePoint Designer is a free and powerful (and hence often banned) tool from Microsoft for modifying your SharePoint site. Using Designer it’s possible to alter a view so that it uses Today when rendering the data on the page. This done by modifying the view’s XSLT (the template the view uses to decide what data goes where).

If you’d like a dabble to test the water of such changes, MSDN has a nice tutorial on how to get started.

However, if you already have some experience with Designer (or you’d like to just jump straight in), Greg Osimowicz has an article on using Today in XSLT to calculate holidays accrued to date (scroll down to “Below are the steps I followed:”).

Code studio6

There are a number of possible different methods to solving this problem using a custom field type. As always this comes with my standard disclaimer that developing a custom field type from scratch for a single purpose requires a disproportionate investment of time for the results.

In 2010 it’s possible to do the calculations in the custom field type class (with some light persuasion), however this is not possible with 2007 as it does not use the class to render its information on list views.

Unfortunately not even CAML can save us in this instance, as the View Schema doesn’t provide the current date in a usable form. But if you’re using 2010 you may be able to create a workaround with XSLT and Greg’s Designer XSLT solution in the section above.

The last option is to use the field type to get JavaScript onto the page instead of using a CEWP. This has the benefit that you don’t need to put the CEWP on each page, but as I mentioned in my previous article it can be very troublesome to do so: How to do list highlighting in SharePoint

SharePoint Highlighter currency_dollar4

Normally this is the section where I’d talk about the benefits of a commercial solution, and try to avoid mentioning SharePoint Highlighter too much (I might even link to our product comparison page). However, it’s very difficult to talk in general terms about commercial products on the market that have this functionality when yours is the only one that does.

So I’m not going to beat around the bush: If you want to buy a commercial solution to change your list view display based on today’s date, then SharePoint Highlighter is the only (and hence best) solution. It does much more than just this, but I’m not going to blow my trumpet too much.

If you want to see a real life problem and its solution using SharePoint Highlighter; have a look at this SharePoint Overflow question.