Posts

SharePoint 2010 - Items Added By Anonymous Users Cannot Start Workflows

Image
On a public-facing website on SharePoint 2010, I was building a simple list to be used as the Contact Us form, so that when an item is added to the list, a workflow will run which sends an email to the owner of the website. It all worked fine until I tested as an anonymous user that wasn't logged in.  I could create the item fine, but the workflow would not run.  The reason for this is, when an item is created by an anonymous user, the item does not set an author against itself (created by, modified by), which means the Workflow does not know what permissions it should use to run. Turns out there's really only one way to get around this.  Open up your old mate Visual Studio and create an Event Receiver on the ItemAdded event.  What needs to happen is as soon as the item is added to the list, the event receiver will grab the item, and set the Author value to something generic (I used the System Account), then run the workflow. (code in text at the bottom of thi...

Programmers need to KISS

An old teacher once asked me why people think programming is so hard.  Being someone who enjoys it, I couldn't give him a good reason.   His reply was simple.   Programming is not hard.  In fact, there are  FOUR  things you need to understand to be a programmer Programs can run commands sequentially (1 line at a time) They can loop through commands (repeat the same code multiple times) They can handle conditional statements (If, Then, Else) They can transfer control And there are only TWO things that can go wrong Syntax Error Logical Error So next time you get stuck on some mind-blowing complex piece of code, just remember...  K eep I t S imple S tupid.

SharePoint 2010 - Calendar with multiple resources and Double Booking prevention

So I know this is an OOTB feature, but I'd been looking for exactly this solution for (let's be honest) quite a while. A SharePoint Calendar with which you can book items/resources like projectors, laptops, meeting rooms, etc.  A calendar that also checks whether that resource has already been booked on that specific date and time. Anyway, There is an official Microsoft article at the bottom of this post, but because it took me so long to find, I'm duplicating it: 1.  Activate the 'Group Work Lists' Feature for the Site. 2.  Enable'Resource Reservation' in the Calendar List Settings > Title, Description and Navigation 3.  Ad resources to the 'Resource List' that would have been created when you enabled the Group Work Lists Feature 4.  Use Calendar 5. Profit Official Article: http://office.microsoft.com/en-au/sharepoint-server-help/enable-reservation-of-resources-in-a-calendar-HA101810595.aspx

SharePoint 2010 - Publishing Site 'Pages Library' no-no

Earlier today I wanted to modify the address of the 'Pages' library on a SharePoint 2010 site.  The reason behind this was to make the naming of the folders more user friendly for our developers who would be deploying reports there. There wasn't a way to do it from the standard GUI, so I decided to modify it in SharePoint Designer (Hey, if SP Designer allows you to do it via GUI, it's safe right? ... right!?). Bad move, as there's some behind the scenes magic that must be hard-coded to the Pages URL, which breaks the Navigation Settings page (this one: http://[sitecollection]/_layouts/AreaNavigationSettings.aspx). 'An Unknown Error has Occurred' - Great.. I'm sure there would be a way around it, but for the sake of saving a few hours of investigation, don't change the name of your Pages Library! Ciao ciao!

SharePoint 2010 - People Picker that is showing the wrong user profile information

Hi again, introduction to this issue:  Someone has updated information on their MySite but their details have not propagated through to the People Picker, or any list that shows User Information in it. Why:  This is due to the User Information List , which is used to supply User Information to all the SharePoint functions that use it.  The User Information List only seems to get updated when a user is first introduced to a Site Collection.  Not even a full Profile Sync will fix it. (You can find the User Information List here: http://[rootsite]/_layouts/people.aspx?MembershipGroupId=0).  This issue has been documented before and done very nicely on Gary's blog here:  http://blog.falchionconsulting.com/index.php/2011/12/updating-sharepoint-2010-user-information/ The difference is between Gary's blog post and mine, is that his shows how to get a script to iterate through every Web Application and update specific fields.  Where as I will be sh...

Making a jQuery banner from scratch

Woah, hang on a minute...  You mean you want me to build my own jQuery solution from scratch!?  Why would I do that when there are so many pre-packaged jQuery solutions out there? Good question, if you are only making something very simple, maybe you'd like to optimise the amount of code the browser has to execute, and the pre-packaged solution may have many more features than you need...  Ok, I'll admit that's a bit far fetched for me to use as my own excuse.  I had some spare time, and wanted to see how easy it was. The answer, as always, is it depends. I was migrating a website from the early 2000's to a SharePoint site and I just wanted to replace a simple flash banner that faded in/out images & animated text.  Great little project I thought. Here's how: First I made a simple HTML page with a div for every image and sentence I wanted to fade in and out.  and an id against every div, so that I could reference them in the jQuery. <head...

Entertainment book - Melbourne CBD - 2012-2013

Go to 2 expensive restaurants that do 2-for-1 and you've already made back the money you paid for the book. Oh wow, now you have 700 other tickets of varied usefulness that can save you cash. I personally prefer just to use all the restaurant ones as they give you the most value for money and force me to go to new restaurants!