Navigate Up
Sign In
Supporters of Developer
Web

How to Create Anonymous Contact Form with SharePoint 2010

Item is currently unrated. Press SHIFT+ENTER to rate this item.1 star selected. Press SHIFT+ENTER to submit. Press TAB to increase rating. Press SHIFT+ESCAPE to leave rating submit mode.2 stars selected. Press SHIFT+ENTER to submit. Press TAB to increase rating. Press SHIFT+TAB to decrease rating. Press SHIFT+ESCAPE to leave rating submit mode.3 stars selected. Press SHIFT+ENTER to submit. Press TAB to increase rating. Press SHIFT+TAB to decrease rating. Press SHIFT+ESCAPE to leave rating submit mode.4 stars selected. Press SHIFT+ENTER to submit. Press TAB to increase rating. Press SHIFT+TAB to decrease rating. Press SHIFT+ESCAPE to leave rating submit mode.5 stars selected. Press SHIFT+ENTER to submit. Press SHIFT+TAB to decrease rating. Press SHIFT+ESCAPE to leave rating submit mode.

You may also be interested in: SharePoint Fest Denver 2013

 

Editor's note: Contributor Khoa Quach is SharePoint Development Leader and developer at Affirma Consulting. Follow him @quachhongak

I recently received a request from a client which seemed very straight forward at first but ended being a little trickier than I expected. So hopefully this will help someone out.

  1. Client has a SharePoint 2010 publishing site
  2. Client wants to allow anonymous access to the entire site
  3. Client has a simple contact form. It needs to be a SharePoint list. Once submitted, it needs to email different internal groups depending on the subject selected.

Initial thought

Well, I thought it will be as simple as this:

  1. Set up the web application to allow anonymous access – pretty straight forward
  2. Go to the site collection (publishing site template, this is actually important)– allow access for anonymous user to the entire site collection
  3. Create the SharePoint list
  4. Provide “Add item” access to the Anonymous users.
  5. Create the Form using InfoPath – why not right?
  6. Create the SharePoint Workflows with “If” statements that redirect according to the subject selected from a Choice type of field. Start it when an item gets created. Publish.
  7. Test
  8. Done

Actually, if you go that route there are going to be a couple of issues:

  1. I encountered issues with the InfoPath form. Signed-in users were able to see the form but not anonymous access. Even, with the anonymous access set properly. I actually remedy this by disabling the following feature
  2. After that, the form was showing for anonymous users and at submission, the entry was added to the SharePoint list but the workflow was not kicking in for anonymous users. (Grrrrr….) There is actually a solution for that, I will develop later on.

Ok, well here is what I did. I think, from my research and different conversations I've had with other SharePoint techies, it is an acceptable solution. Please comment.

Solution:

  1. Set up the web application and the site collection for anonymous access.
  2. I am not going to expand on this as there are plenty of great articles out there that will describes step by step how to go about this. The following article is the one I used: http://www.topsharepoint.com/enable-anonymous-access-in-sharepoint-2010

    At this point we should be able to access the SharePoint site anonymously. Yay!

  3. Create the SharePoint list
  4. This depends on your requirements. Let’s say that our form will contain the following fields:

    • Title | single line of text | required
    • Subject | Choice (HR/Marketing/IT) | required
    • Body | Multiple lines of text | required
    • Simple enough, now let’s give “Add item access to the anonymous users”

    • Go to your newly created SharePoint list, go to the list permissions
    • 2013-01-09-AnonContactForm-01.png

    • Stop inheriting the permissions (if not already done)
    • 2013-01-09-AnonContactForm-02.png

    • You should see the Anonymous Access icon
    • 2013-01-09-AnonContactForm-03.png

    • Once you click on it, select the “Add items” option checkbox. This should be good for our scenario but feel free to add more options if necessary
    • 2013-01-09-AnonContactForm-04.png

    • Note: I had the options originally greyed out and was not able to activate. If you are in the same situation, this may be because of list settings >> advanced settings >> item-level permissions. Do not set to “Read items that were created by the user” or “Create items and items and edit items that were created by the user”
    • Click OK

OK. At this point we provided the ability to our anonymous users to add items.

Then create your InfoPath form. I will not go into detail and assume that this is performed easily, there are no options in InfoPath that should be different from a regular InfoPath form on a portal (Hint: you have to go to SharePoint Designer. If you need further details on that I could write something in a future post).

However this is optional, you could use the default form provided by SharePoint or even create new forms from scratch.

At this point, there is going to be an issue if you try access your forms whether it is an InfoPath form or a regular SharePoint form page.

In fact, if you try to access the SharePoint list “All items” view or any of the form views (Edit/New/Display), your anonymous user will encounter an error message. From a SharePoint page displaying the InfoPath form in a web part, you will encounter an error message too.

Not good. I learned that since our SharePoint site collection template was the publishing site infrastructure, the SharePoint feature “ViewFormPagesLockdown” was actually impeaching anonymous users to access system settings pages. Therefore, we need to disable that feature. This also means that all the SharePoint lists and document libraries' views will be accessible to anonymous users. (I have yet to find a way around web.config file? Any input is welcome)

Anyway, here is how to enable/disable:
http://blogs.msdn.com/b/russmax/archive/2010/01/22/lockdown-mode-in-sharepoint-2010.aspx

At this point our anonymous users can go and add new items to the contact form list.

Ok, last couple of steps.

Creating SharePoint workflows should be easy enough at this point. But I will hold off until I read this excellent article/solution at: http://blogs.ibs.com/duane.odum/lists/posts/post.aspx?id=19. In fact, your workflows will hang if run as an anonymous user. The reason why is that “SharePoint Designer workflows will not trigger for items added or updated by anonymous users. [Note: Prior to SP1, declarative workflows could run under System Account. If you have upgraded to SP1 then this is no longer possible. See comments below for possible solutions]" .

I follow, to the letter, the steps from the previous link and it worked out like a charm.

Note: If during your search you come across this article at: http://blog.furuknap.net/enabling-declarative-workflows-for-anonymous-users-in-sp20102007; this will not work for items added from the UI but only email added items. Good resource for another project though.

Source:

Categories: Security; dev; InfoPath; SharePoint Designer; MOSS; WSS; 2010

Comments

http://www.bestessay.net/research-paper.php

best

Using the SharePoint object model it is easily possible to create a custom properties panel for a custom Web Part, known as ToolPart.

индивидуалки Новосибирска

simple

Client has a simple contact form. It needs to be a SharePoint list. Once submitted, it needs to email different internal groups depending on the subject selected.

onlinecasino777.ru

cool

Choice type of field. Start it when an item gets created. Publish.

Posted 21-May-2013 by onlinecasino777.ru
Mekong cruise

Ok

I often use Google Doc Form . I think it is free and pretty easy to use and more consistent with the trend .

Posted 25-Jun-2013 by Mekong cruise
china wholesale

china wholesale

Posted 29-Jun-2013 by china wholesale
24 hour locksmith near Sheffield

SAME

Large! Acknowledges for your records, its been same beneficial. Blesss extra for sharing your info.

Posted 15-Aug-2013 by 24 hour locksmith near Sheffield
ebook

df

I was searching the code which is used professionally. Then I saw your blog. I want to congratulate you on such a wonderful blog.

Posted 06-Sep-2013 by ebook
queens no fault doctor

thnx

I am currently working on an assignment and I have been exploring your blog for a few hours. Thank you for your post it proved helpful for me.

Posted 08-Sep-2013 by queens no fault doctor
niki

debt

You got a really a smart blog and You also know how to make people rally behind it, obviously from the responses. debt consolidation

Posted 09-Sep-2013 by niki
BOY

COOL

Your site is fantastic. I’ve bookmarked your site in my browser; I hope in future days I’ll get more valuable information from your site. gay sex cams

Posted 04-Oct-2013 by BOY
RYAN

GUD

Later that, the image was showing for anonymous users further at prostration, the door was added to the SharePoint slate however australia writings the workflow was negative kicking in for anonymous users. (Grrrrr….) There is indeed a resolution for that, I resolution ripen after on.

Posted 17-Oct-2013 by RYAN
sex cams free

Thats all I are able to say.

Thank you for this post. Thats all I are able to say. You most absolutely have built this blog website into something speciel. You clearly know what you are working on, youve insured so many corners.thanks....

Posted 25-Oct-2013 by sex cams free
Fake Oakleys

Oakley Outlet

Oakley Frogskins Sunglasses lens uses high carbon fiber material, with a super lightweight, Resistance to shock. Not easily broken by attribute and use high-grade lenses and radiation of the Sun.Cheap Oakleys Perfect combination of UV materials, can be cut up to 385nm,100% UV ultraviolet Oakley Sunglasses in the movement as a whole can withstand strong impact without breaking, eye protection and do no harm to the human body, called the sport and is absolutely safe. Car buff most desirable sports sunglasses! Fake Oakley M Frame Sunglasses products based on the bionics principle of the human body, Mechanical principle, carefully designed optics, careful study of the human facial features comfort nose pads, for the analysis of movement in all directions, the unique design of curvature of the mirror frame buffer movement forces, lenses of different colors, suitable for different sport occasions. Most of Oakley Sunglasses Cheap styles are streamlined, and unique!

Posted 03-Nov-2013 by Fake Oakleys
leatherp

leatherp

No longer something I would normally learn, but I liked your thoughts none the less.

Posted 07-Dec-2013 by leatherp
Monclerstyle

Moncler On Sale

Forrester research analyst ted schadler said in a research note on october 5, 2006, that blu ray will win out because it has more support, with over 100 manufacturers compared to hd dvd 10.According to schadler, dell, apple and sony Cheap Moncler Kids will ship pcs with blu ray drives.Hd dvd has toshiba in the pc fold. For example, experts estimate that the mydoom worm infected approximately a quarter million computers in a single day in january 2004. (Times online).Back in march 1999, the melissa virus was so powerful that it forced microsoft and a number of other very large companies to completely turn off their email systems until the virus could be contained. Carmine persico was a real tough guy.Small in stature, scrawny and ugly in appearance, one hand was twisted from a bullet wound;He had also been shot in the face during the first gallo wars.The incident, that went down in mob lore had him and a partner in Cheap Moncler Kids crime, alphonse d'ambrosia, sitting is a car as a group of gallo hoods drove by shooting at them with a m 1 carbine. Instead of having the record companies give me new digitally cleaned up versions of these recordings from the 60's and 70's, i wanted to use the vinyl i've been listening to for years complete with all the pops and cracks.I even kept the sound of the needle being put down on the record.Basically because i wanted people's experience to be the same as mine when they hear this soundtrack for the first time. ". I used apple at work Moncler Kids Jackets and pcs at home so i just don care except i refuse to listen to arguments about which is better.What important is what you do with your computer the creative side not who has the easiest interface.Both of them are perfectly adequate. Be prepared for people to not like something.Stay open to constructive criticisms, suggestions, input.Remember, you want this to be an amazing Moncler On Sale product for others.The family seldom uses the clothes dryer. "It's one of the largest consumers of electricity in your home,"Says desantis, who lives in milton with his wife, kathy, and their son, mark.Instead, they hang their wash on racks.

Posted 18-Dec-2013 by Monclerstyle
eavedrop44

informative

I have been waiting for someone to share this post. This has actually made me think and I hope to read more. Thanks a lot for sharing with us.SEO Manchester

Posted 08-Mar-2014 by eavedrop44
eavedrop44

informative

Thanks for giving us opportunity to post in your blog. This gonna be fun lots of people will comment and provides information that make this page so interesting. Thanks for giving us opportunity to post in your blog.Web Design Manchester

Posted 19-Mar-2014 by eavedrop44
guess sacs

Sacs à main Guess

Je pense que cela doit être une règle dans la famille Kardashian / Jenner. Eh bien, je suis sûr qu'il ya quelques règles différentes, mais je suis sûr que ce sont deux grands: 1. Vous devez posséder au moins cinq guess portefeuille et 2. Vous ne devez voyager avec des valises Guess. Bien sûr, il ya beaucoup de célébrités portent des sacs à main Guess quand ils voyagent, mais les Kardashians et la Jenners semblent avoir tellement sacs Guess et bagages, j'aimerais vraiment voir où ils stockent ce genre de choses pour que je puisse aller et compter combien de nombreuses pièces, il ya! Dans tous les cas (heh, obtenir - «cas») Vérifiez Kendal et Kylie Jenner être chic à l'aéroport avec leurs sacs de créateurs Guess rouler derrière eux. Ils ont l'air si mignon - comme des jumeaux qui s'habillent de même je suppose qu'il doit être génial d'avoir un surplus de sacs GUESS et bagages autour de vous à tout moment. Je suppose que lorsque vous grandi dans la vie comme ça, vous êtes tenu d'avoir un lot de montre femme guess de créateurs et d'accessoires à votre disposition. Sentez-vous une certaine envie dans ce poste? Eh bien, si vous le faites alors vous avez raison parce que j'aimerais avoir des sacs de créateurs Guess pour moi. Dommage pour moi, je ne peux pas! Se permettre des sacs Guess. Je peux, toutefois, obtenir le même style de Guess que j'aime moins avec sac guess. Sacs à main Guess gardent toujours en me regardant comme un million de dollars sans avoir à dépenser, peut-être vous devriez commencer votre collection de GUESS sac pas cher trop!

montre guess homme http://www.guess-sac.com/montre-guess.html montre guess blanche femme

Posted 24-Mar-2014 by guess sacs
eavedrop44

informative

Wonderful article. It is useful for me, thanks a lot for giving everyone an exceptionally splendid possiblity to read in detail from this blog. I really enjoy reading in your blog! SEO Liverpool

Posted 02-Apr-2014 by eavedrop44
replica gucci handbags

watches

If you are interested in the particular economical bottom socks pertaining to guys you’ll be able to also choose the particular relaxed men’s staff socks that you can get involved the retail price selection of USD some to be able to. With regard to more comfortable along with the type 100 % cotton bottom sock pertaining to http://ggbags.co.uk guys could possibly be the best choice pertaining to winters. Rolex Replica Daytona is bit heavy in the weight as this watch is a thick watch to fit your wrist in a more fashionable way! Moreover it is found with the crystal material for avoiding the scratches & other related issues.In short, purchasing this watch is as lovely as purchasing the watch of the year! Take the expensive cost of the genuine watches in to consideration.

Posted 06-Apr-2014 by replica gucci handbags

Notify me of comments to this article

E-mail:
   

Add Comment

Title:

 
Comment:
Email:

   


Name:

 
Url: