https://your_sp_site.sharepoint.com/_api/web/lists/getByTitle(‘Test’)/breakroleinheritance(copyRoleAssignments=true, clearSubscopes=true)
https://your_sp_site.sharepoint.com/_api/web/lists/getByTitle(‘Test’)/roleassignments/addroleassignment(principalid=20,roleDefId=1073741828)

 

Reference from :

http://spsite.pro/Blog/Post/3/SharePoint-2013-REST-API-%E2%80%93-How-to-set-Unique-Permissions-(Item-Level-Permissions)#disqus_thread

http://sharepoint.stackexchange.com/questions/113317/manage-file-permissions-using-rest-api

https://msdn.microsoft.com/en-us/library/office/dn495392.aspx

 

If the current user who run the javascript has site owner permission the ‘created by’ filed can be changed when you create item or update item in the SharePoint list.

However the user has only contribute permission, the field would not be changed even though you specify the ‘author’ field.

I just tested using CSOM Javascript on SharePoint 2013 so next time I will test using Restful Javascript.

var userIDnumber = you have to get the specific user id;

oListItem.set_item(‘Author’, userIDnumber );

 

Sometime when I using SharePoint Dev machine, the resources of the Dev machine could be limited.

1. You can disable search feature by setting wrong account/password for Search host controller and Search server 15.

 

Noderunner processes take too much memory
2.

Get-SPEnterpriseSearchService | Set-SPEnterpriseSearchService –PerformanceLevel “Reduced”

or

3.

change noderunner config file

memoryLimitMegabytes value as 200

C:\Program Files\Microsoft Office Servers\15.0\Search\Runtime\1.0\noderunner.exe.config

(if you reduce this memory size the crawl would be timed out even though you reinstall search service)

 

 

Reference)

http://www.falconitservices.com/support/KB/Lists/Posts/Post.aspx?ID=182

http://social.technet.microsoft.com/wiki/contents/articles/20413.sharepoint-2013-performance-issues-with-search-service-application-on-a-development-vm.aspx

https://blogs.technet.microsoft.com/mpriem/2012/09/05/sharepoint-2013-preview-hungry-search-service/

 

It can be applied into list, document library, content type or site.

however there is no way to set previous date such as [created – 7].

it only allows + operation and is not allowed for calculated field.

 

Maybe this can be utilized some daily workflow job instead of custom event receiver  if we just create new SharePoint management list. need more idea for this.

 

create custom retention formular :

http://www.c-sharpcorner.com/UploadFile/0e18a8/custom-expiration-policy-in-sharepoint-2013/

 

https://mikesnotebook.wordpress.com/2013/05/20/sharepoint-retention-policies/

https://technet.microsoft.com/en-us/library/cc262490.aspx

http://blogs.askcts.com/2014/06/16/sharepoint-information-management-policies/

https://github.com/OfficeDev/PnP-Guidance/blob/master/articles/SharePoint-Add-In-Recipe-information-management-policy.md

Using The Information Management Policy (Specifically The Retention Policy) In SharePoint 2010

 

Reference from : http://www.habaneroconsulting.com/insights/why-are-my-sort-orders-not-working-in-my-sharepoint-2013-search-results-web-part#.VfeRHxGqqko

Even tought I set up sorting in the query of search result web part, the sorting was not affected into webpart.

This is because of JSON sort applied regardless you tick ‘Show sort dropdown’ box.

Sotution

  1. use result source using sorting.
  2. update JSON sort definition in the web part.

For example)
[{“name”:”A-Z”,”sorts”:[{“p”:”PreferredName”,”d”:0}]},{“name”:”Z-A”,”sorts”:[{“p”:”PreferredName”,”d”:1}]}]
[{“name”:”First Name”,”sorts”:[{“p”:”PreferredName”,”d”:0}]}]

p means managed property name

d means descending

[
   {
      "name":"Name and Location Sort",
      "sorts":[
         {
            "p":"Name",
            "d":0
         },
         {
            "p":"Location",
            "d":0
         }
      ]
   }
]

Normally when downloading all the files from SharePoint Document library, we use ‘Open with Explorer’ and just drag and drop to specific driver.

However if the file counts are over the list threshold limit, you can’t open the ‘open with explorer’ with errors.

Of course you can increase the threshold limit but how about just use powershell script to download all the files include folders.

This is originally from the blog : http://blogs.msdn.com/b/varun_malhotra/archive/2012/02/13/10265370.aspx

$destination = “F:\\test”
$webUrl = “https://aaa”
$listUrl = “https://aaa/CardDocs”
##############################################################

$web = Get-SPWeb -Identity $webUrl
$list = $web.GetList($listUrl)

function ProcessFolder {
param($folderUrl)
$folder = $web.GetFolder($folderUrl)
foreach ($file in $folder.Files) {
#Ensure destination directory
$destinationfolder = $destination + “/” + $folder.Url
if (!(Test-Path -path $destinationfolder))
{
$dest = New-Item $destinationfolder -type directory
}
#Download file
$binary = $file.OpenBinary()
$stream = New-Object System.IO.FileStream($destinationfolder + “/” + $file.Name), Create
$writer = New-Object System.IO.BinaryWriter($stream)
$writer.write($binary)
$writer.Close()
}
}

#Download root files
ProcessFolder($list.RootFolder.Url)
#Download files in folders
foreach ($folder in $list.Folders) {
ProcessFolder($folder.Url)
}

Follow

Get every new post delivered to your Inbox.