2

I'm trying to create an "unanswered questions" view on my discussion board so that users cannot see previous questions I've answered.

I've got SharePoint Designer 2013, however the software is still a bit new to me.

4

The discussion board list has "Unanswered questions" and "Answered questions" view by default.

enter image description here

The question in which at least one of the replies is marked as "Best Reply" will show in the "Answered questions" section.

enter image description here

If the question does not has "Best Replay", it will show in the "Unanswered questions".

enter image description here

Note: Only questions which the "Question" field is "Yes" will displays in "Unanswered questions" or "Answered questions" view.

Per my research, we cannot set "Unanswered questions" view as the default view of the Subject view.

As the workaround, we can use JavaScript to open the "Unanswered questions" automatically.

1.Edit the page -> insert a Script Editor web part to the page.

2.Save the page and then edit the page. This step is used to refresh the ids of the elements on the page.

3.Use F12 developer tools to check the id of discussion board list web part.

enter image description here

4.Enter the following script to Script Editor web part.

<script src="https://code.jquery.com/jquery-latest.js" type="text/javascript"></script>
<script type="text/javascript">
var timer1
    _spBodyOnLoadFunctionNames.push("ready");
    function ready(){
          if($("#MSOZoneCell_WebPartWPQ2").find("a:contains('Unanswered')").length==0)
          {
              ($("#MSOZoneCell_WebPartWPQ2").find("img.ms-ellipsis-icon")[0]).click();
              time1= setTimeout(test,500);
          }
      }

     function test()
     {
       $("a:contains('Unanswered')").trigger('click');
     }
      clearTimeout(timer1);
    </script>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.