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: