Tuesday, March 7, 2017

This view cannot be displayed because it exceeds the list view threshold (5000 items) enforced by the administrator.

“This view cannot be displayed because it exceeds the list view threshold (5000 items) enforced by the administrator.

To view items, try selecting another view or creating a new view. If you do not have sufficient permissions to create views for this list, ask your administrator to modify the view so that it conforms to the list view threshold.”

image

And if you are more dig in to it, the error will be occur in your

  • Web Parts
  • Custom Scripts
  • SharePoint Apps
  • CAML Queries

Which is related to that list.

First we have a look why this is happening.

The Live View Threshold is item count which is limited by SharePoint Administrator to process by SharePoint server at a time.

Further elaborating when you are viewing or query (CAML, ODATA, and REST) against the list SharePoint will process the entire set of items to get the required results even though you have mentioned limits or filters unless it is not indexed.

Thus when it is exceeding threshold limit (5000 default) SharePoint will throw that error to you.

 

HOW TO RESOLVE

Increase the List Threshold as a Temporary Fix

The easiest way is Increase the Threshold List View Limit. But this should be temporary and it is not good for server performance.

First you can go to Central Administration and then Manage web Applications

image

Then select the web application you need to increase the List View threshold. And go to general settings and Resource Throttling.

image

Then you can change the List View Threshold to accommodate the list items limit.

image

 

Recommended Approach to use Indexed Columns

Recommended approach is used to cater this problem using indexed columns. If you use the index column SharePoint does not need to iterate entire list to deliver the results.

Let’s have a look for sample scenario. Assume that you have a list with 6000 items over 5 years’ time and your default view throws that error.

So first you need to increase the List View Threshold to perform operations as I mentioned in the temporary fix.

Then you need to create an Indexed Column.

Most common used scenario is use [Created] SharePoint default column as an Indexed column. But might be differ from your scenario.

 

Create an Index Column

Go to List settings and click on indexed columns

image

Click on the Create a new Index Link

image

Then choose a column that you need to Index and Create It as an index column.

image

Then you can edit the Filter in Default view to show only last year by adding [Today]-365 as an filter expression.

image

Then you can change the List Threshold back to 5000. But make sure you are adding [Created] column expression for your CAML queries, REST queries and other queries.

Thursday, March 2, 2017

SharePoint Web site Keep on Prompting for credentials– Full Article.

This article breaks into three sections.

  • Identify and Cause

  • Add Exception to Strict Name Checking

  • Disable Loopback

Identify and Cause

There are many reasons to happen this but most of the time it will happen when you change the Access mapping to match your domain.

For an example you might have webwfe01 as your web application in your default zone. And if you change that to www.sampleweb.com this may be occurred for Windows Users.

image

This is because by not having Fully Qualified Domain name specified is not matching with the local machine.

For an Example,

Your local machine can be in a domain myorg.com and the specified Mapping is sampleweb.com

Thus this will cause LoopBack check which it true by design for security reasons.

Microsoft specifies two methods to resolve the issue.

  1. Disable Strict Name Checking

  2. Disable Loopback Check

REF: https://support.microsoft.com/en-us/help/896861/you-receive-error-401.1-when-you-browse-a-web-site-that-uses-integrated-authentication-and-is-hosted-on-iis-5.1-or-a-later-version

You need to do it all SharePoint servers for safe side in the future service deployment. But it is necessary for all Front End servers.

Disable Strict Name Checking in IIS

This is use full in many scenarios. For me it’s more use full for disable keep on prompting credentials in SharePoint 2013 Environment.

In this method you need to add your domain as an exception list to IIS for not checking the FQDN for loopback.

Open the RegEdit.

image

And navigate to

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa

and click on MSV1_0

image

Then add new Multi Connection String

image

And add BackConnectionHostNames

Then you will see that is added to the registry.

image

You can double click and add your fully qualified domain names (One per line) that will be working as an exception.

image

Then you can save and restart the IIS.

Disable Loopback Check in IIS

This is use full in many scenarios. For me it’s more use full for disable keep on prompting credentials in SharePoint 2013 Environment.

In this method you can simply disable the check by editing the following registry key.

Open the RegEdit.

image

And navigate to

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa

image

Click on Lsa Registry and add DisableLoopbackCheck registry key as DWORD value.

image

After adding the registry key you can find the entry as follows.

image

Then double click the key and Enter 1.

image

And click OK.

Then restart the IIS.

Thursday, February 16, 2017

You are being redirected to the following url that was not registered as the app launch url

“You are being redirected to the following url that was not registered as the app launch url https://xx?SPHostUrl=xx&SPLanguage=enSPClientTag=0&SPProductNumber=xx&SPAppWebUrl=xx&{AppContextToken} If you trust this url, click here to proceed to the app now. Otherwise go back to the previous page or close this page."

It is common that you may have encountered this kind of an error when you are accessing an App that you have developed and published to the SharePoint 2013.

There can be many deep reasons behind the message such as

  • Not provisioning the app web correctly
  • Errors on App management service

But most of the time it is because of not registering your app in the SharePoint.

You can simply follow following steps to register your app in the current SharePoint site.

First go to Appreg.aspx page which used to register the app in http:// xxx/_layouts/15/Appreg.aspx. Then you will find a following interface where you can register your app with SharePoint.

image

But you need to make sure the values you are entering is matching with the AppManifest.xml in your solution.



<?xml version="1.0" encoding="utf-8" ?>
<!--Created:cb85b80c-f585-40ff-8bfc-12ff4d0e34a9-->
<App xmlns="
http://schemas.microsoft.com/sharepoint/2012/app/manifest" Name="ShopSAdmin" ProductID="{4813c773-d1b1-4ec6-8274-32f1152bd6b7}" Version="1.0.0.1" SharePointMinVersion="15.0.0.0" >

<Properties>
<Title>ShopSAdmin</Title>
<StartPage>~remoteAppUrl/Pages/default.aspx?{StandardTokens}</StartPage>
</Properties>

<AppPrincipal>
<RemoteWebApplication ClientId="*" />
</AppPrincipal>

<AppPermissionRequests>
<AppPermissionRequest Scope="
http://sharepoint/content/sitecollection" Right="Manage" />
</AppPermissionRequests>
</App>

Tuesday, February 14, 2017

Insufficient SQL database permissions for user 'Name: doman\SP_UserProfiles SID:

Insufficient SQL database permissions for user 'Name: doman\SP_UserProfiles SID: S-1-5-21-2738186777-3937669245-3595685374-1123 ImpersonationLevel: None' in database 'SharePoint_Config' on SQL Server instance 'ADXWSQL.adxweb.ae'. Additional error information from SQL Server is included below.

The EXECUTE permission was denied on the object 'proc_putObjectTVP', database 'SharePoint_Config', schema 'dbo'.

This is a caused by not having permission to database objects of using least privileges configuration in farm configuration. Thus you need to give permission exclusively to this Object.

First you need to Connect to SharePoint Database using privileged account.

Then go the SharePoint Config Database and security section. Then go to Roles and find WSS_Content_Application_Pools under the Database Roles section.

image

Double click (or Right Click -> Properties) the item and select the Securable section in the modal window.

image

And click Search.. and select Object Type in the Window and Click OK.

image

Then click on Object Types and select the Stored Procedure.

image

Type proc_putObjectTVP in Object names section and check names for select the item.

image

and select the item and Click Ok.

image

Then you can see the item in the securable and give the execute permission to the object.

image

Tuesday, January 17, 2017

All you want to know about Exception from HRESULT: 0x80131904 in SharePoint 2013/2010

This error is very common in SharePoint environment and there are few reasons to cause the issue. But as a root cause every issue is needs to do something with SQL server installed in your SharePoint Server.

Cause 1

This is the most common reason and most of the SharePoint environment and it is due to Low Disk Space in your SQL Server.

image

When

You might see this when you are creating a New Page or New Item in SharePoint environment. Basically you are trying to contribute to the SharePoint Environment.

How to Resolve.

  • If it is SQL Express environment make sure you are not exceeding the limit of 4GB.

  • Check your Hard Disks spaces in SharePoint SQL Server for Log Disks and Date Disks.

Cause 2

You might see this error when you are opening a SharePoint List and believe me this is also very common scenario when you are working with SharePoint.

image

This is caused by not having read permission to columns items in the list which might be a lookup list and the current user does not have permission to read that item in the reference list.

So the case will be there might be a permission issue in the reference list to read.

  • First case there might be not having persimmon at all to read. You can check the permission from the list permission setting.

image

image

If the user has permissions check tem-level permissions in Advanced List Settings. Users may have restricted to read only items which is created by same user.

image

Cause 3

Having more columns exceeding the SharePoint limits of Row Ordinal may cause this errors.

SharePoint Stores data in SQL Table. If SharePoint can not stored in a One row it will store the data in another column and which will be handled by Row Wrapping Property.

So Row Ordinal it will be sequence of 0 to upper margin of the Row Ordinal.

Assume you have a SharePoint list item which is storing data in two rows and row ordinal. So Fist few columns will be stored in Row 1 and next set will be stored in Row 2.

But when you change the order of the items which is already stored it may be false to two different row ordinal and might cause the issue.

So you can change the column order again to make your environment work.

Note: You can change the maximum limit by using following script.

$web = http://mywebapplication

$webapp = Get-spwebapplication $web

#the default value is 6

$webapp.MaxListItemRowStorage = 8

$WebApp.update()

 

Cause 4

This is also a common issue when you are using CAML queries and Specifying data type which is not the actual data type and not compatible type.

Assume You have a Column Boolean and you are specifying text in the field Query.

Incorrect CAML Query that throws an error

<Eq>

<FieldRef Name="AcctualBooleanFeild" />

<Value Type="Text">Yes</Value>

</Eq>

Correct Query

<Eq>

<FieldRef Name="AcctualBooleanFeild" />

<Value Type="Integer">1</Value>

</Eq>

This is happening because conversion failed happens in SQL level when SharePoint tries to execute the query.

 

Cause 5

There can be a situation you are getting this error after you migrates one SharePoint content database to another SharePoint Server. Simple when you mount a database from another farm to your farm as a content database.

This may be also causing read conflicts with SQL database for users. You can delete the Unique permission in SharePoint Cashed profile to resolve this issue.

image

And delete any unique permission in the List.

Cause N

There can be many caused other that mentioned. I have resolved few by just restarting my SharePoint SQL environment . You can also give a try Smile

Tuesday, January 10, 2017

Converting O365 / SharePoint App to SharePoint 2013 on Premises Solution

Generally when you are developing SharePoint Provider hosted apps you can simply user SharePoint Online version to do testing and development.

But when it comes to actual deployment you may need it to deploy as SharePoint on premises solution.

You can do it by simply adding few additional configuration sections to web.config.

image

This is the default web.config you will have when you are working with O365, SharePoint Online Apps.

If you want to convert the same application to host in your premises as a provider hosted application. You just need few entries in your web config.

image

You need to specify Authorization and SSL certificate communication settings. After that you can configure your environment to host the application as High Trust SharePoint Application.

<configuration>

<system.web>

<compilation debug="true" targetFramework="4.5" />

<httpRuntime targetFramework="4.5" />

<authorization>

<deny users="?" />

</authorization>

</system.web>

<appSettings>

<!-- Following values are critical to communicate app with shrepoint server -->

<add key="ClientId" value="21da123c-b1c9-4d54-9cb1-ee36b5f91304" />

<add key="ClientSigningCertificatePath" value="C:\inetpub\wwwroot\Certificates\sample.pfx" />

<add key="ClientSigningCertificatePassword" value="password" />

<add key="IssuerId" value="d250d0bc-d44e-4d8b-9e36-567817943628" />

</appSettings>

<system.serviceModel>

<bindings>

<basicHttpBinding>

<!--Used by app for SharePoint-->

<binding name="secureBinding">

<security mode="Transport" />

</binding>

</basicHttpBinding>

</bindings>

<protocolMapping>

<add binding="basicHttpBinding" scheme="https" bindingConfiguration="secureBinding" />

</protocolMapping>

</system.serviceModel>

<system.webServer>

<httpProtocol>

<customHeaders>

<add name="Access-Control-Allow-Origin" value="*" />

</customHeaders>

</httpProtocol>

</system.webServer>