SharePoint 2010 Start a Workflow on Item Delete

Recently on a client project we ran into a scenario where they wanted users to be able to make a request to delete an item but not really delete the item. The user would make a request and then the administrator would come and either delete the document or keep it based on the needs. This got me thinking about how to make this easiest for the users. I decided to create a custom workflow and add a quick action to the item dropdown. This would make it seem simple to the user since they are used to this action for deleting items. Since the dropdown is already security trimmed they wouldn’t see the standard delete so there would be no confusion with me adding my delete and using the same icon. Since I think this would be a common scenario I wanted to blog about it so that others can see what approach I was using. My example below is not the same one that I used for my project but instead a simple sample scenario that should get you moving in the right direction.

  1. Create a Document Library
  2. Configure permissions so that the users will not have the ability to delete items. Usually for this I create a custom permission level called Contribute – No Delete and then assign that permission to the members group. Once this is completed, those users will not see the option to delete within that library.

     

  3. Next we will want to create the workflow that we want to start when the item is deleted. For my example the workflow is going to email the creator of the document and let them know that it has been deleted and provide them a link to email the person who deleted the item. I am just doing this as an example, in theory you could create any workflow here.

     
     

     

     
     

    **Note: to delete the document we need to use the Impersonation Step because the person kicking off this workflow will not have access to delete the items but the author of the workflow does. If this concept is new to you, then you can look here for some additional information about workflows.

     
     

  4. Once we have the workflow created, we will want to use SharePoint Designer to create the quick action for the library. Below are the screenshots for my configuration.

     
     

     

     

    **Note: You can use the Rights Mask option to only make the action visible to users with certain permissions. Click here for a list of the different values you can use to configure this. This may not apply to a delete workflow but I imagine there are plenty of times that you want different workflows for different users. This approach may help you only show was is relevant for that particular user. An example I used recently was a workflow for standard users and then a different version of the same workflow (more configuration options) for users who could manage the lists.

     
     

  5. As a final step in customizing the workflow I am going to customize the form so that the initiation screen appears to the user like a confirmation screen.

     

     
     

     

     
     

  6. Now we can test the final solution.
    1. Quick Action in the List Menu

       

    2. Workflow Initiation Form

       

    3. Item is Deleted from Library

       

    4. Email is sent to creator

       

 
 

**Note: After posting this blog, Brian Jackett sent me a link to a similar blog on his site by guest author Lucas Eduardo Silva around this topic. His solution uses custom code to accomplish the same type of task. What I love about community is that everyone shares the different ways that they accomplish the same thing. Since we are all sharing what we are doing we have a large pool of experience to pick from. Here is the link to the article if you would like more information on his approach.

SharePoint 2010 Using Lookup Column to Link Directly to a Document instead of the Properties Page

I will start by saying that this solution isn’t super elegant and if I was looking to do this on a very large scale I would probably look for a different approach. But for the task at hand, it works and is manageable 😉 I think it is worth sharing because I imagine others will run into similar scenarios. I encourage you (like I would for all scenarios) to test this approach out to make sure it will work for your intended solution.

Scenario: There is a collection of FAQs that have a lookup to an associated procedure. Users are able to access the procedures from the lookup field, however they are only able to open the properties page (see below). Instead what they would like would be the ability to open the document directly from the FAQ and bypass having to open the document properties page.


Since in 2010 we can have multiple columns associated with the lookup I figured we could just add a link to the document as Since in 2010 we can have multiple columns associated with the lookup I figured we could just add a link to the document as part of the field and then have the link referenced as a column. That scenario falls apart because you can’t reference a rich text or link field as an additional column for a lookup. Instead what we are going to do is to create a column in the document library that will hold the formatted link to the document as a string. We will then go into our FAQ list and add that column as an additional lookup column. We will then add that column to our view, along with the content editor web part that converts text to html (see this blog for more information, as that web part was not developed by me).

  1. Add Column to Library –


  1. Create the workflow to populate this column whenever a new item is added or an item is changed.
    1. Create Workflow


  1. Create String Variable to Hold Value


  1. Set variable to value : <a href="Current Item: Encoded Absolute URL ” target=”_blank”> Current Item: Title


  1. Set list field = variable


  1. Add document to library to test workflow. (note the text is formatted in html so you won’t be able to click the link- we will address that in a future step).


  1. Add lookup column to FAQ list.


  1. Add CEWP to page where the column is displayed so that the html is formatted. This would need to be the last web part on the page. In our example we are adding it to the default display form (as customized in this blog post)
    1. Download the html lite code here: http://pathtosharepoint.com/Downloads/Forms/AllItems.aspx
    2. Add the text from the download to a CEWP.


  1. Ensure that the web part is the last one on the page and that it is set to hidden.


Now, when you view the item from the page you added the CEWP you will be able to directly access the document and bypass the properties page.


SharePoint 2010: Customize the Default Display List Form Using Only OOTB Web Parts

I have been working on a project that contains a list of FAQs. Basically we would like users to be able to quickly review the FAQs to find the answers they need. Pretty simple concept. The FAQ list is pretty basic and contains the following columns: Question, Answer, Rating, Associated Documents. Entering the FAQ is pretty easy and straightforward. Viewing the FAQ list item however leaves a few things to be desired. My initial thought was the simple “oh we can just use InfoPath to build a custom view”….well…sad to say but in this case we don’t have enterprise so that option was out the window. My next thought was to use SharePoint Designer to create a custom list view. I thought about it for a minute but decided that it was too much effort for just the simple changes I wanted….so back to the drawing board. I got thinking about how the Display form is just a web part page, so I decided to start playing around with the OOTB web parts to see if I could get close to what I wanted. I ended up getting exactly what I had in mind. I will start by showing you the before and after screenshots and then walk you through the process I used to get there. This is a very basic and simple solution but I think it is still a good one to share. Sometimes keeping it simple is the best option. Also, this would be a good solution when Enterprise isn’t installed or where SharePoint Designer has been disabled.

Before:


After:


Because of the way we have laid out the web parts on the display page we are able to provide a much cleaner view of the list content for a user when they access the list item. The ribbon and everything remain the same and if they need to edit the item they can easily do so from the Ribbon and will get the same view they expect from the creation of the item.

To get started, you will want to access the Form customization option from the Ribbon. In our case we will select to edit the Default Display Form:


The page will open in edit mode and you should see something similar to the screenshot below:


Since I don’t like to remove any of the standard pieces, the first thing I will do is hide this web part. This will allow it to remain on the page but not be displayed and it will also allow it to act as our filter for the new web parts we will be adding to the page.


Now, I will just add the web parts to the page that I want to use. In my scenario I will add three instances of the FAQ web part to the page. For each of the web parts I will configure the views that I would like to have displayed within that web part. For my example I am keeping the Question / Answer together in one view and having a separate view for the Ratings and the associated procedures.


Once the web part is added I will edit the current view and select the view properties that I need:


Once I have the view configured, I will need to add the connection so that only the items for the current item are displayed. I do this by adding a web part connection to the web part we previously hid.


My parameter for this connection is where the ID in the hidden webpart is equal to the list item ID.


Now I just repeat the steps for each web part that I want to add to the page and before long, my finished view looks like the one below.

Note: In case you are wondering I made use of the Newsletter style for the web part. It is one of my favorite views because it adds some formatting in a nice and easy format for reading. I also hid all of my toolbars and set each web part to display with a border. I formatted each web part the same to help bring consistency to the page. I encourage you to play around with the different settings until you find what you like the best.


Since you can add web parts to any of the display views you could also use this approach in combination with InfoPath forms services views. This would be a good way to add back some of the fields that InfoPath Forms services doesn’t support (managed metadata or rating columns). I should have a blog soon on my approach for using this in combination with forms services.


SharePoint 2010 Calendars Overlay

There are some great new features with Calendars in 2010, specifically I am referring to the overlay feature. This feature basically allows you to add additional calendar views to your view and display the entries with a specific color. Here are some screenshots of the feature. It looks like the limit is 10 calendars and you can add either SharePoint or Exchange calendars. I didn’t have easy access to exchange, so I just tested the SharePoint calendars. I added 2 new overlays to my view – another calendar (Calendar 2) and a Tasks Lists Calendar View (Tasks). This shows that any list that has a calendar view can be displayed in the overlay.




SharePoint 2010 Use an SPD Workflow to Build Custom Search URLs

I am currently working on a prototype for a client that will be used by various users to access common policies and procedures. One of the requirements of this solution is that if a user happens to select the wrong policy or procedure that they can easily be re-directed to the correct one. Since we don’t really know what the user was thinking when they selected the item, it might be difficult for us to know how to best redirect them. We decided that a good potential solution for this would be to utilize search. This way we can simply rely on the data currently in the system and all we need to do is develop a list of common terms that users “might” have meant when they accessed the current policy or procedure. The theory is that we will keep a list of common search terms and then whenever a user selects one of the terms they will conduct a search that returns items with that keyword. From the search results they should be able to see a wide enough selection of content that they can hopefully narrow in on the correct procedure. The list will be managed by the site owners and they can add items to the list based on feedback from the users.

Here is a quick screenshot of the home page of the prototype I am working on:


To build the solution I created a custom list called search terms with two columns- Search Term (title field) and Click on Term to Search (Rich Text Field).


Once I had the list set up I created a simple workflow in SPD that updates the Click on Search Term Field whenever the title is updated or when a new title is created. Since my field is a rich text field, I can use SPD to build a custom html string.

My workflow is associated with the Common Search Terms list and is configured to start manually, whenever an item is updated or when anything is modified.



There are only two actions for my workflow:

  • Create Variable
  • Set Field in Current Item


In the set variable action I am using the string builder to add the title of my search term to my URL.


The text that I am using above is the HTML that is going to create the hyperlink for me. The two sections highlighted below show the location that you would use to insert the title from the current item. We have also added the “target=_blank” parameter so that the search results will open in a new window. This isn’t required, however was requested in my scenario.

 

” target=”_blank”>[Current Item: Title]

 


Since this workflow runs whenever items are updated, the site owners will be able to quickly update the related search terms. And since the values are just a column in a list, site owners will be able to create a web part that displays only that field and display the web part anywhere on the site. In the example below clicking on the link called Procedure will open a new window with a search query on the term Procedure.


To update the list the site owner simply needs to add a new list item to the list (Note: if you didn’t want the extra field to be displayed on the list form you could hide it via InfoPath or by creating a custom content type):


Keep in mind that there is a lot you can do with search parameters in the URL so you could also limit this search to scope or to multiple parameters. I am sure there are multiple ways to accomplish this same task, but I found this solution a pretty quick and easy method that I can see as valuable in a few different scenarios. I hope you find it useful!

Lync 2010 Launch

Last week I had the opportunity to attend the launch event for Lync 2010 in NYC. It was my second trip to the city and the event was a great experience. The night prior to the launch we were invited to a reception where we got to spend some time chatting with Kirk Koenigsbauer about some of the new and different things happening in the next year. There are a lot of really great things happening and as someone who spends a lot of time working with Information Workers I am excited to hear about the steps that MS is taking to make more relevant information easily available. We also chatted a bit about Office 365 and the power it will bring to organizations. I know Office 365 won’t work for everyone, but I am excited about the new opportunities it will bring to the market.

The actual launch event was great. The keynote kicked off with a call from Bill Gates and then consisted of many relevant demos. The thing that stood out to me the most was the ease of use when working with the tool. From an end users perspective the system seemed very intuitive and easy to work with. I am looking forward to getting it installed within a dev environment so that I can get some more hands on testing and also create some follow up blogs that show the integration with SharePoint.

Below are some links that provide some more information about Lync. I definitely recommend that you spend some time looking around. If you aren’t already using Lync, maybe you should be!

Here are some of the pictures from the trip and the launch event:



SharePoint 2010 Using the Lookup Column to Display an Image

Last month I was asked a question about lookup columns from a user who had read through my SharePoint 2010- Lookup Columns Additional Column Options post. They wondered if there was a way to have an image column be pulled over as part of the lookup using the additional fields option. While you can’t do it directly, there is a way to accomplish it using an SPW Workflow and some extra columns.

Here is the question:

Is there a way to display an Image in Lookup field? I have an Images displaying in list that I’m pulling fields from, but image field does not show up in “Additional fields” group. It is a “Hyperlink or Picture” field formatted as a picture.

Here is a potential solution:

In the list that contains the image links you want to reference, add an additional single line of text column. In my example I will call this column “Image URL”. Create a SharePoint Designer Workflow that when an item is added or deleted the Image URL field is set to the value stored in Image, where Image is your Hyperlink or Picture field formatted as a picture. The finished results would look similar to what is below:

New Item Page:


List View:


Workflow:


In the list that you want to do the lookup, create the lookup column and include the Image Transfer as an additional Field. Also, create a Hyperlink or Image field formatted as a picture. You would then use an SPD workflow to take the value from the additional field and set the Hyperlink field. Once the fields are set, you could just use views to hide and display the specific fields you want to show.

New List Item:


List View:


List Column Settings:


List Settings View:


Workflow:


Using this approach could get you what you needed, but it does require an additional column in each library. You could use content types to hide and display the columns, but that adds another level of management. I am not sure if that would be a good solution for all cases, but I did want to put it out there as a way to complete the request. I am sure there are other ways as well to complete the same task.

#SPSColumbus, #BPC10, #SPTechCon & the book……

I have definitely been off the grid lately! I have been working on finishing up our book and to be honest that took just about everything I had, so sadly blogging got put on the back burner. The book is almost done, so I should be able to pick up blogging again. I wanted to start by sharing a few of the different events I will be at this year:

First off, here is the link to the book that I have been working on. It will be released later this fall. I have had an opportunity to work with some great co-authors and I am very excited to see the final product!

Beginning SharePoint 2010: Building Business Solutions with SharePoint

http://www.amazon.com/Beginning-SharePoint-2010-Building-Solutions/dp/0470617896


Next up is SharePoint Saturday Columbus. We have been planning the first SPS event in Columbus and we have had some great responses! I hope if you are in the Columbus area that you will be joining us!

SharePoint Saturday Columbus

http://www.sharepointsaturday.org/columbus/default.aspx


Here is the session I will be leading at SPSColumbus:

Working with Lists and Libraries in SharePoint 2010

Do you know all of the different things you can do using SharePoint lists and libraries? In this session, we will take a look at the different out-of-the-box list features and how they can be combined to build powerful no-code business solutions. We will look at the new features available in SharePoint 2010 and how they can be used to increase productivity. Some of the new features include working with lookup columns, new list settings, new view settings, inline editing and custom form creation.


Following SPSColumbus will be the Best Practices conference. This will be my first time attending / speaker and I am very excited! This is one of those conferences where you really get to dig into the “why” you should be doing things, or not doing things. There is an excellent line up of speakers and I am honored to be able to speak alongside them. In addition to conference sessions they have several “Ask the Experts” events as well as full day conference sessions. If you haven’t checked out this conference yet, you should! Registration is still open, so it is not too late to make plans to attend!

Best Practices Conference

https://www.bestpracticesconference.com/


Here are the two sessions I will be leading at BPC10:

Best Practices for Managing an Effective SharePoint Team

At the root of every successful SharePoint implementation is a team supporting it and making it possible. But how did the team get started and who should be part of the team? In this session we will look at the best practice guidelines for building and maintaining an efficient SharePoint team.

Building Solutions that Users Get

There are many different ways to build solutions within SharePoint, from lists and libraries to workflows and alerts. How do you know what approach will work best for the solution you are building? In this session we will look at some best practices that can be followed to ensure that the approach you are taking with your site design is an approach that your users will understand. We will review what key factors should be considered up front to ensure that any solutions you develop are understood and embraced by your users.

And finally, this October I will be back in Boston for SPTechCon. I have been able to speak at all of the SPTechCon events so far and must say this is one of my favorite conferences. The atmosphere is small enough to make good connections, yet large enough to really get to see how the rest of the world does things!

SPTechCon

http://www.sptechcon.com/


Here are the two sessions I will be leading at BPC10:

Working with Lists and Libraries

Do you know all of the different things you can do using SharePoint lists and libraries? In this session, we will take a look at the different out-of-the-box list features and how they can be combined to build powerful no-code business solutions. We will look at the new features available in SharePoint 2010 and how they can be used to increase productivity. Some of the new features include working with lookup columns, new list settings, new view settings, inline editing and custom form creation.

Creating an Electronic Forms Solution Using InfoPath and SharePoint

Paper, paper everywhere! There are so many forms in an office to keep track of that the task can overwhelm both the people who create the forms and those who fill them out. This class will show you how to ensure everyone is using the correct version of the form and create dynamic forms using InfoPath 2007 and the Forms Server capabilities built into SharePoint.

I really hope to see some of you at these events! Hopefully in the next week I can start back up with my blogging and can get around to answering some of the comments that have been posted to the blog. I just need a few more hours in each day

SharePoint 2010 Insert Related List on List Display Form

There are a few things that come standard in 2010 that really make me happy. They are things that I have been doing for a while in 2007; however now in 2010 they can be done with just a simple click or two!

Scenario:

  • List of Projects
  • Library with Project Documents, lookup metadata to associate each document with a project

Goal:

  • Display all the associated documents on the list display page for the Projects List.

To get started you will need to create your projects lists and your documents list and then add a lookup column to the documents list.



From there, the configuration is a breeze. Start by accessing your projects list. In the List tab of the Ribbon, under the customization section, select the Default Display form link.


Then select the Insert Ribbon option and the Insert Related Items Option. You will notice that all lists that have a lookup to this list are listed here and available for connection.


When you select the documents, a web part is added to the page, configured with a filter so only the associated documents are displayed. Also, since this is a standard web part, you can easily modify the way that the web part is displayed (change the view or other properties).


Here is a screenshot of the updated display page:


All of this in 5 easy clicks If you are interested in seeing how this same task would be done in 2007, you can refer to this blog post. As you can see the improvements in 2010 will be quite the time saver!