Sharepoint 10 Lists: Want to Limit Form Fields to User Groups

I am creating a service request ticket system using the functionality of SharePoint 10 lists. I want to hide some form fields from the end user when filling out the form, but I want people who are administrators to see all the fields in the form. One example would be hiding end users of the "Assigned:" field form. Not sure how to do this. Thank you in advance.

+2
source share
6 answers

Download the jQuery and SPServices libraries and put them in a read-only document library or in your 14 Hive, depending on what suits you. Then edit the NewForm.aspx list (using SP Designer) and add links to the two files.

Add a script tag with the following:

$(document).ready(function() { Admin_Group = "My Group Name"; if(IsGroupMember(Admin_Group)) { $('input[title="Assigned To"]').parent().parent().css("display","none"); } }); function IsGroupMember(GroupName) { var isGroupMember = false; $().SPServices({ operation: "GetGroupCollectionFromUser", userLoginName: $().SPServices.SPGetCurrentUser(), async: false, completefunc: function(xData, Status) { if($(xData.responseXML).find("Group[Name='" + GroupName + "']").length == 1) { isGroupMember = true; } } }); return isGroupMember; } 

You may need to verify that the input selector is correctly referencing the assigned or the field to be hidden, but I used this approach in many situations. Make sure the field you are hiding is optional. Also remember to hide it in EditForm.aspx if you need it.

+2
source

You can do this by editing the view / edit form in the SharePoint or InfoPath designer, but you need quite a bit of knowledge about XSLT or InfoPath to do tricks like these. For InfoPath see: http://blog.symprogress.com/2011/05/infopath-list-form-hidedisable-fields-based-on-sharepoint-group-membership/

Or you can create your own websites for every item you need using Visual Studio.

Or you can use a product that is the easiest way: http://store.bamboosolutions.com/sharepoint-column-level-security.aspx

+1
source

I know that you can create list views, which are basically views from the MVC template, which can be a list entry. In your case, it will look like: viewing the list of tickets for managers and viewing the list of tickets for TI. You should search the list views for sharepoint. Hope this helps.

0
source

I had to do the same in my organization, where we built a help desk system. Users only needed a few fields, such as "Subject", "Description", "Maturity Date", where the support staff had a number of fields, including notes assigned, etc.

The easiest way is to create a custom NewForm.aspx for the list.

You can do this in the SharePoint designer by copying the existing NewForm.aspx, pasting a custom list form onto the page, setting the Visible attribute in the existing one to false, and then deleting lines of information that you don’t want users to.

Then just apply that NewForm_Trimmed.aspx as the new default form, and that should do it.

EDIT: SharePoint Designer 2010 simplifies this process ... Follow this link: http://office.microsoft.com/en-us/sharepoint-designer-help/create-a-custom-list-form-using-sharepoint- designer-HA010378258.aspx

0
source

We use the Sharepoint Forms Designer tool. This allows you to create specific forms for different sharepoint groups.

0
source

My answer is similar to Paul, but structured somewhat differently. We had the same requirement in the form of a list, although in our case we hid certain elements based on group membership. You will need to do the following:

  • Add a link to jQuery and SPServices on your homepage or in your editing form. We use the homepage setting in our environment.
  • Ideally, create a new custom form for your list and make it the default. It is generally not recommended that you modify the vanilla forms if you can help them.
  • Open the editing form in SharePoint Designer and add the following script to it:

 $(document).ready(function() { $().SPServices({ operation: "GetGroupCollectionFromUser", userLoginName: $().SPServices.SPGetCurrentUser(), async: false, completefunc: function(xData, Status) { if ($(xData.responseXML).find("Group[Name = 'Engineering']").length == 1) { // alert("You shouldnt see the button."); $("input[id = 'AcctBtn']").hide(); } } }); }); 

In your case, you really want to do the opposite - by default, hide certain fields, and then show them if the user is in a group. Just duplicate the middle row (where it hides the input field) for each item you want to change. This way, you can easily show or hide several elements in the form for users in this SharePoint group.

0
source

Source: https://habr.com/ru/post/905602/


All Articles