NOTE : This article was published on EndUserSharePoint.com a couple of weeks ago and because of the wonderful feedback I received, I decided to cross-post it here too.
This is the fourth article in a multipart series that is intended to help you create mailing lists for your SharePoint sites or blogs without writing a single line of .NET Code. In the introductory article, I listed the project initiatives, requirements, and objectives. In Part 1, I created a secured backend where we will store the subscribers’ contacts. In Part 2, I configured the ‘Contact’ content type, created a subscription form for the mailing list and did some simple customizations to it. In Part 3, I utilized the thrilling DataFormWebPart to further extend and enhance the subscription form to meet the project requirements.
In the previous article, I promised to tackle a new area, which is “SharePoint Designer Workflows”. However, while writing the promised article, I received some e-mails, from followers of this series, asking about the country lookup feature I mentioned in the project requirements.
“When filling out the form, users should select their countries from a drop down list, which holds all the countries of the world.”
I found a zillion of articles throughout the web covering the “lookup fields” and “lookup lists” topics into enough depth and listing their gotchas and limitations. However, I will provide you with some steps, tips, and free stuff that you will definitely need to implement this requirement. To make this article more useful, I will also explain some other topics during the implementation like List Templates and SharePoint field type conversions. I’ll show you how to modify the FormField Controls and how to mark a list as invisible using SharePoint Designer.
- Navigate to SPCountries Feature page at CodePlex and download the Countries List Template as shown below:
Note: Do not forget to allow anonymous access to this list as I showed you in the first article.
4. Now, you need to change the “Country/Region” field type to “Lookup (information already on this site)” rather than “Single line of text” to gets its values from the “Countries” list you just created.
5. Navigate to the Contact content type settings page from the list settings one.
6. Oops! You cannot modify the “Country/Region” field to be a lookup one! Yes, this is not supported by design, for a list of supported SharePoint field type conversions, refer to this article.
7 . For the sake of simplicity, I will just delete the default “Country/Region” column and replace it with a new lookup one as shown below.
8. To mark the “Countries” lookup list as invisible (Only the list and not the included content, which should be available to all the site users including anonymous ones), open up SharePoint Designer, supply your credentials, and follow the steps illustrated by the following figures.
9. Open the custom subscription form. Unsurprisingly, you will get an error like the one shown below.
10. The reason I have received this error is that I’ve modified the list fields and some form fields are still looking at the deleted country field. To fix this error, modify the FieldName attribute values of the FormField and FieldDescription controls to be “Country” instead of “WorkCountry” or you can just useFind and Replace to achieve the same result.
11. Save your form, the error is gone
12. Preview your form from the browser and there you go; now you have a list with a form analogous to the one I have shown you in the introductory article… Congratulations!
Since the kick-off of this series, I have received amazing feedback from EUSP visitors and my blog followers. I would like to extend a special thank-you to everyone who took time to drop me an e-mail, follow me on twitter, or even leave me a comment. Your feedback means a lot to me.
I noticed that most of the questions that I have received lately focused on the sixth requirement. For easier reference, I have copied it below.
“List administrators should be able to send e-mails to all the approved and registered users specifying some filters. For instance, the list administrator should be capable of sending e-mails to all the registered users from Canada”.
Starting with the next article, I will explain how to implement this requirement, which will involve the creation of primary and secondary workflows, integrate SharePoint lists with Microsoft Outlook and Microsoft Word 2007.
As I told you in the beginning of this article, I had already started writing about SharePoint Designer Workflows before I received questions about the lookup fields and lists. When I was doing a research to avoid writing what has already been written, and to elaborate where others are vague or incomplete, I stumbled upon a great article by Paul Galvin titled “Email and SharePoint Designer Workflow” which provides a deep explanation to what I was about to cover.
Therefore, if you are new to SharePoint Designer workflows, I would encourage you to have a look at this article. So you’ll be ready for my next post which will directly start creating and implementing the needed workflows without discussing what was smartly discussed by Paul as I am not a fan of reinventing the wheel.
So until I talk to you again, check out my blog at http://www.aymanelhattab.com , where you will find shorter articles, tips and tricks, questions and answers, and downloadable content. You can also follow me on Twitter http://www.twitter.com/aymanelhattab or drop me an e-mail firstname.lastname@example.org if you have any questions.
EndUserSharePoint.com is a community of SharePoint authors dedicated to providing content to SharePoint End Users on three levels: Information Worker, Power User/Site Administrator and Site Collection Administrator.