Sunday, May 25, 2014

Hide SharePoint Calculated Columns


Note that you can't hide the SharePoint calculated columns by the normal way, you have to use PowerShell to do that !

$web = get-spweb http://SPWeb/Site/subsite $list = $web.Lists["list name"]
$field = $list.Fields["Column Name"] $field.ShowInDisplayForm = $false $field.ShowInEditForm = $false $field.ShowInListSettings = $false$field.ShowInVersionHistory = $false$field.ShowInViewForms = $false $field.ShowInNewForm = $false
$field.Update($true) $web.Site.Dispose()

Thursday, May 8, 2014

Access denied error while editing SharePoint 2013 List item.

While editing an item in a SharePoint 2013 List, I faced this error: "Access denied. You do not have permission to perform this action or access this resource" although the user has already an edit permission!!! 

I checked the ULS logs and the exception was "Original error: System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"

After alot of searching, the solution was so simple, go to List settings > Advanced settings, and in the "Item-level Permissions" field, change "Create and Edit access:   Specify which items users are allowed to create and edit" to "  " ... then save



So Simple ... huh ?!

Monday, May 5, 2014

SharePoint 2013 Workflow gets Suspended

I was stuck with the error of Workflow gets suspended automatically.
Only Users with Full Control Permissions could make workflow start with no problems, but any user else face this problem.

RequestorId: eda26c74-95ef-2733-0000-000000000000. 
Details: An unhandled exception occurred during the execution of the workflow instance. 
Exception details: System.ApplicationException: HTTP 401 {"Transfer-Encoding":["chunked"],"X-SharePointHealthScore":["0"],"SPClientServiceRequestDuration":["200"],"SPRequestGuid":["eda26c74-95ef-2733-9cb7-5327536614d3"],"request-id":["eda26c74-95ef-2733-9cb7-5327536614d3"],"X-FRAME-OPTIONS":["SAMEORIGIN"],"Cache-Control":["max-age=0, private"],"Server":["Microsoft-IIS\/8.0"],"WWW-Authenticate":["NTLM","Basic realm=\"SharePoint.contoso.com\""],"X-AspNet-Version":["4.0.30319"],"X-Powered-By":["ASP.NET"],"MicrosoftSharePointTeamServices":["15.0.0.4420"],"X-Content-Type-Options":["nosniff"],"X-MS-InvokeApp":["1; RequireReadOnly"],"Date":["Mon, 05 May 2014 07:55:44 GMT"]} at Microsoft.Activities.Hosting.Runtime.Subroutine.SubroutineChild.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

I made sure the User Profile Service is Configured and I did the full synchronization, and the user has a profile.

Finally nailed it by following steps:
1- Make sure the Workflow History List has the same permissions as your list, or grant a unique permission ,Contribute, for the users who will use the workflow.

2- Make sure the Workflow Tasks List has the same permissions as your list, or grant a unique permission ,Contribute, for the users who will use the workflow.

3- Check your workflow through SharePoint Designer and check permissions granted in any related list in the workflow ( That Solved my Problem, As I had another list which I get data from it and by mistake permissions there changed ) 


Usefull Links For Same Issue:


Wednesday, April 2, 2014

Get SharePoint SubSite List items via PowerShell

If you want to get all items in a specific list in Subsite, PowerShell can help:

Add-PSSnapin Microsoft.SharePoint.PowerShell –erroraction SilentlyContinue

$spWeb = Get-SPweb "http://sp/site"

$subsite = $spweb.Webs | where {$_.title -eq "SubSiteName"}
$lists = $subSite.Lists
$mylist = $lists | where {$_.title -eq "ListName"}
$mylist.GetItems() | select name


Tuesday, April 1, 2014

Sorry, We couldn't find your file. is it possible it was moved, renamed or deleted? SharePoint 2013,SkyDrive,OneDrive,Office Web Apps


I was trying to Edit a document -which hosted on SharePoint- in client side Word application , but I faced this error "Sorry, We couldn't find your file. is it possible it was moved, renamed or deleted? " followed by half of the URL.




After alot of trails I found the best ways to solve this issue, as it was not clear in most of the websites.

First:
Restart-Service AppFabricCachingService

Second:
You have to check the client side, as my problem was there, my Microsoft Office edition didn't allow me to open the file, Try to Repair it , or better to UnInstall then Install it again


Last:
Use the following PowerShell in your environment:


$config = (Get-SPSecurityTokenServiceConfig)
$config.AllowOAuthOverHttp = $true
$config.Update()


Also you can find more in the following links:
http://blog.sharepointsite.co.uk/2014/01/office-web-app-ran-into-problem-opening.html

http://social.technet.microsoft.com/Forums/sharepoint/en-US/31c6d108-e94d-41a1-99a9-570b3880eb33/sharepoint-2010-and-office-2013-cant-edit-documents

http://social.technet.microsoft.com/Forums/sharepoint/en-US/9662d5cf-0381-4c70-89cb-301ec1ea4439/sorry-we-couldnt-fine-your-file-is-it-possible-it-was-moved-renamed-or-deleted-skydrive?forum=sharepointgeneral