Monday, April 1, 2013

How to Customize/Replace the “You are not allowed to respond again to this Survey” SharePoint 2010 Survey Message


Survey Questions can be easily created on SharePoint 2010, where it is often required that no user fills the Survey twice. This can be easily achieved in OOB (Out of Box) fashion.

But the problem is that user sees the error message like the one shown below (Pic 1) which will definitely not look good on your Site and there is no easy way to change this.

There are many ways to fix this issue but the approach which i applied was on the client side Ecmascript method. As shown in the image on left we will be performing the following tasks.

  • Create a Link to Survey Question.
  • Include a CEWP on the page where the image having link to survey question will be shown.
  • The code in CEWP will checks if user has responded to survey earlier
  • Based on response Show either "Thanks for feedback :Image 2" or "Fill the Feedback: Image 1"
Ok so before we start this was the Error message we get if a user tries to fill the Survey again.(OOB way) but we dont want this screen to appear
How to get the Link to Survey Questions
  • Open the Survey List and get the code for replying to survey as shown below
  • Copy the code in a Notepad file. This will be looking somewhat like the below code.

  • Now add the CEWP to the page where you want the user to click on the Image to Fill up the Survey. I have shown the below image as the link to survey in my example.
  • The image we will be showing after the user fills up the survey is (This image will not have any hyperlink)
  • So to do this transition we will put the below code in the CEWP










Budget Submission

So we will now never get the error message that the user has not registered becuse if the user is already registered then we will not show the hyperlink to the survey questions..

5 comments:

  1. I have tried this, but it is not working. Do I add an image and link this code to it?

    ReplyDelete
  2. How can we customize the default survey creation page with extra fields like: expire date, Target audience, Thankyou message

    ReplyDelete
    Replies
    1. I guess the question answer is not straightforward, and I have never done the same aswell. But after some investigation here is what I came up with.

      Survey List new list Item gets called up when we call the page like

      http://</_layouts/new.aspx?FeatureId={00bfea71-eb8a-40b1-80c7-506be7590102}&ListTemplate=102


      The feature Id is same in sharepoint 2010. (Not sure of 2013)

      Now to change this feature and provide some more inputs to the same, we have to create custom list based on the existing template.If you want extra fields on your list, you will first have to define a custom list definition based on the generic list and then create a list instance based on that new list definition.

      Here are the links which will help you in doing the same.

      http://karinebosch.wordpress.com/walkthroughs/create-custom-lists-in-caml-based-on-existing-list-templates/

      http://karinebosch.wordpress.com/walkthroughs/creating-a-custom-list-definition-based-on-a-generic-list-using-a-custom-content-type/


      Now using the above two overwrite the survey list contenttype and add your new items.

      Delete
  3. Mister Hemant Joshi

    You save my life today, on a SP survey for my IT Director

    Great Job

    ReplyDelete
  4. nice blog sir v.v. help full for beginner..thanks

    ReplyDelete