Hot answers tagged

6

Here is a script that gets the UniqueId of a list item: <script type="text/javascript"> $(document).ready(function() { ExecuteOrDelayUntilScriptLoaded( function() { var itemId = ....; // change to the real id var listTitle = .... // the list title var ctx = SP.ClientContext....


4

Try this #Variable for Web URL $WebURL ="Your URL " # Varibale to hold document count $count = 0 #get Web object $Web = Get-SPWeb $WebURL if ( ($web.HasUniqueRoleAssignments) -and ($web.IsRootWeb -eq $false ) ) { $web.ResetRoleInheritance() Write-host "Broken Inheritance Reset on web:" $web.URL } #Get Lists with Unique permissions - Exclude Hidden ...


3

You can use Out of the box ID column inorder to have unique ID for your list item. Go to List Tab > Modify view > Check the ID column and click Ok.


3

It will be treated as one unique permission. Setting folder permissions is a best practice, consider this article - Best practices for using fine-grained permissions: Only set unique scopes on parent objects such as folders. If you want to learn technical things, limitation and best practices regarding permissions even more deeply, consider also ...


3

First add the List Item so its Id is generated, than get the item again... Update its Title field and concat Id column with it.. Pseudo-code below: ListItem newItem = lstObject.Items.Add(); newItem["Field"] = "something"; newItem.Update(); newItem = lstObject.Items.GetItemById(newItem.Id); newItem["Title"] = "YourText" + newItem.Id.ToString(); newItem....


3

I would argue that the reason these libraries have unique permissions is precisely the opposite of what Ankit Kumar is suggesting. In Ankit's answer: these libraries deal with configuration of the site collection and is generally used for referring any scripts /site images and any style sheets. Hence these library have unique permission where general ...


3

you can create a separate Project eg. "Common" where you include those classes. You can reference that assembly than from your other Projects. Of course, you have to ensure that this wsp is installed along your other wsps (which use that dll)


2

Each question is essentially a column, you could ask the question in a different format. You have to tell yourself, if the questions aren't really identical in what it's asking, let's change the question. If the data being last year is what is unique, include that in the question. Otherwise you need to find a way to trick SharePoint to use the same format ...


2

Yes you can achieve this , and you will need to do enhancement the same . http:///_vti_bin/listdata.svc/Tasks?$filter=Team eq 'Team3' http://www.c-sharpcorner.com/uploadfile/anavijai/rest-api-in-sharepoint-2010-for-listdata-svc-part-1/


2

You can create a view and set following properties Group By = Choice Field Sort = Modified Descending Order Now you can open the view using SharePoint Designer and modify the XSLT to limit the items per group to one.


2

Hers is the code you need to use in Event Receiver... int newID = 0; //Get current year int currentYear = DateTime.Now.Year; //Your list name string listName = "Test"; //CAML string assuming 'Title' is the column contains unique ID string ...


2

Both of these can be done with views using Group Bys. Create a view called ByPeriodPerson and in the Group By section of the view definition, select Period first group by the column and then select Person for the second group by the column. The resulting view will display a distinct set of Periods - when you expand each period you will have a distinct set ...


2

When you use BreakRoleInheritance with $true or $false you do the following : you are assigning the folder with unique permissions. Any new permissions added to the item are only applied to the item. Only the difference : $true to copy role assignments from the parent object to this object; $false to assign only the current user to security roles. So For ...


2

You can create a view with the below filter options, Assigned To is equal to [ME] OR Created By is equal to [ME] So in this view, only the items in which the current logged in user is in "Assigned To" column or "Created By" column will only be displayed. This is a simple way to display item in which current logged in user is related to. There is another ...


1

First of all create one Person or Group Field in your list (If you don't have it), say you named it Assigned To. As you are using SharePoint 2010, you can create a SharePoint designer 2010 workflow and use Replace List Item Permissions action to manage the list item permissions. Official documentation: Workflow actions in SharePoint Designer 2010: A quick ...


1

You can try the following PowerShell script to add groups to list/library permissions. Iterate lists and libraries in the site and execute the function. function Add-SPPermissionToListGroup { param ($Url, $ListName, $GroupName, $PermissionLevel) $web = Get-SPWeb -Identity $Url $list = $web.Lists.TryGetList($ListName) if ($list -ne $null) ...


1

I have resolve this issue by using Rest API and first we get the data from list and then we have will use that data on the insert and edit form where inserted data is correct or not. Note: WBS is lookup column UserName is person and group column /_api/web/lists/getbytitle('ListName')/Items?"+"$select=WBS/Title,UserName/Title"+"&$expand=WBS,UserName


1

So, I managed to find a solution for my question. Bellow is Powershell script code: Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue #Variable for Web URL $WebURL ="#" #get Web object $Web = Get-SPWeb $WebURL #Get Lists with Unique permissions - Exclude Hidden lists $ListColl = $web.lists | Where-Object { ($_.hidden -eq $...


1

I solved this problem by adding spaces at the end of the question. SharePoint accepted it and the user couldn't tell the difference.


1

It is by design, I think this has some connection with Publishing. But one thing I know for sure, If you change the permission on any of these System Libraries, you will break the things in your Site collection. Typically peopler removes the Style Resource Reader group from the permission as this include the All authenticated User in it. But as soon you ...


1

This is not supported as you would have to do some rewrites. Even if user would be accessing from different url you would still record answer in same list so not sure how you would differentiate results. Check the rewrite supportability from MS: https://support.microsoft.com/en-us/kb/2818415


1

ODATA Distinct is not possible unfortunately: https://stackoverflow.com/questions/3839073/select-distinct-values-with-odata You may be able to filter distinct values out afterwards ?


1

If i've understood it correctly, security scope as the sum of all the access in a document.So, for your examples, you always have 1. My examples: One list: Two items broken permission can be seen by user a ---> 2 security scope Two items broken permission can be seen by user b ---> 2 security scope Two items broken permission can be seen by users a,b --->...


1

A simple ItemAdding event receiver will do, where you check Uniqueness of the Priority by yourself.. So you can simply do an SPQuery with that Priority and Status = "Open" and get whether it already exists or not.. If exists, you can cancel the adding and write custom error.. properties.Cancel = true; properties.ErrorMessage = "Deleting is not supported."; ...


1

This particular resource string isn't one of the strings externalized in the RESX files in the 15 HIVE. The only way to really change it would be to create a custom form in InfoPath or in Visual Studio.


1

Create a list item event receiver SPItemEventReceiver and override the ItemAdded method. There you will always be able to grab the ID field from the properties parameter and assign it to a different field (single line of text or any other type). Attach the event receiver to your list and you are done. No workflow is required.


1

Normally the file is being checked out to the uploaded when not all mandatory information is filled in. The user needs to fill in the required fields before being allowed to publish the document


1

Maybe you could write an event receiver for Item-Added that would check the property you are interested in like Name and ensure it is unique.


1

Casting the control to its type, and then getting the ID of the BindingContainer, which is the WebPart, allows me to match that parameter to the ID of the Web Part being called. protected void setTwitterName_Click(object sender, EventArgs e) { string Name = TwitterHandle.Text.Trim(); var x = (Button)sender; var WebPartID = x....


1

You should be able to open up the 'Read' Permission level and create a new one based on it (at the bottom there should be a button saying such). Just add the Edit Items checkbox and not the Add new and you should be good to go.


Only top voted, non community-wiki answers of a minimum length are eligible