Skip to main content

Posts

Error: Not enough storage is available to complete this operation

This is the first time I noticed this error message since I started working on client side programming in SharePoint. I have REST API code to pull data from multiple Lists and I'm calling this script in a page through Content Editor Web Part. The error message is not shown on the page. However, the web part is empty without any data. So I turned on the Developer Tools Console to check for any clue. This is where it promptly displayed: Error: Not enough storage is available to complete this operation First thing it stuck me was to check my machine's RAM usage. When I checked in Task Manager, RAM usage was more than 80%. I had opened lots of IE tabs. I closed a couple of browser tabs and RAM usage came down to 50%. I refreshed my SharePoint page and alas, it is showing data as expected! A few questions that came up in my mind: Can we catch this exception so that we can show the user-friendly message instead of the blank web part? How do we optimize the overall ...

How to set character limit for Multiple Lines of Text column in List

Setting a character limit for Multiple lines of text column in a List is not straight forward. Depending upon the setting of the column, the solution varies. Plain Text: When you create Multiple lines of text column with "Plain Text", SharePoint renders this field as "TextArea" HTML element. You can set the character limit by making use of maxlength attribute of TextArea element. $ ( document ). ready ( function () {     $ ( "textarea[id*=FieldName]" ). attr ( 'maxlength' , '1000' ); }); The above script should be injected into NewForm.aspx and EditForm.aspx of SharePoint List. Of course, replace "FieldName" with your field name. Enhanced Rich Text: When you create Multiple lines of text column with Enhanced Rich Text, SharePoint renders this field as DIV with contenteditable attribute set. This is where it gets more tricky. If you closely observe, the IDs of the contenteditable DIV and the corresponding Label D...

How to make Title column mandatory in Document Library

My friend asked this question and I thought why not create a post so that it benefits whoever has the same question. When you create a document library, Title field is automatically added to the library. However if you notice, Title field is optional. If you go to List settings and click on Title field, you will not get an option to make it mandatory. So why we don't get this option? Basically, Title field is inherited from "Item" Content Type. This is added to the "Document" Content Type. By default, Title field is made Optional in the Content Type. So how do we make it mandatory? Follow the below steps: Navigate to Library Settings Click on Advanced settings Set Allow management of content types? to Yes Click OK In Document Library Settings page, under Content Types , click on Document Click on Item Under Column Settings , select Required Click OK Now when you upload a document and navigate to Edit Form, Title field will be mandatory. Note...

SharePoint hosted App Upgrade

Preface: This post was written a long back, but somehow it was never published and was kept in draft mode (may be, I forgot). There might be a new update process published by MS. I'm still publishing this post just to share my learning. Do google/bing for latest information on App Update.

Review of the year 2015!!!

From my SharePoint work perspective, when I look at 2015, it has been a wonderful year. Yes my blog posts were limited compared to the previous year but I've made some progress in the SharePoint front. Here is a quick view of the same. Comfortably switched from Server Side Object model to Client Side Object Model Specifically gained experience in REST API Dived into AngularJS - this has been a wonderful journey so far Got exposure to Kendo UI controls. Combining this with AngularJS provides unlimited opportunities to customize SharePoint sites without using .NET code Got exposure to SharePoint Online (SPO) It has been an enriching experience. I hope to do more for SP community in 2016! Wish all my SharePoint folks a very happy, healthy, and successful New Year!!!

Creating New List Form in Discussion List? Be aware of limitations!

If you add a New Form to the Discussion List and set it as default, you would expect all Discussion List web parts to point to the new form. Unfortunately, it does not! To explain this behavior, let me start with a custom List. Let us take any custom List. By default, it has 3 forms (New, Edit, and Display). Open SharePoint Designer, navigate to this List and add a new "New Form" (call it NewForm2.aspx) and make it as default. Now wherever you have added the above custom List as a web part (List View Web Part), when you click on "new item", it opens up the newly created NewForm2.aspx. This is what we would also expect since we have made it as default New Form. If you closely observe the hyperlink of "new item" in a List View Web Part, it looks as below: http://[domain]/sites/[SiteCollection]/_layouts/15/listform.aspx?PageType=[PageTypeID]&ListId=[ListGUID]&RootFolder= Basically when we click on "new item" link, it takes us to a l...

How to resolve "400 bad request" error in getFolderByServerRelativeUrl REST call

I was working on SharePoint 2013 REST API to fetch the list of folders from a document library specifically a discussion List. The usual lists/getByTitle endpoint gets the list of folders but without the URL of the folder. When I checked the REST API examples at MSDN , one thing which caught my attention was getFolderByServerRelativeUrl endpoint. Unfortunately the examples provided in the MSDN is not correct. As per the MSDN, we need to pass the document library name as a parameter. executor.executeAsync({   url: " /_api/SP.AppContextSite(@target)/web     /getfolderbyserverrelativeurl( '/Shared Documents' )     ?@target= ' ' ",   method: "GET" ,   headers: { "accept" : "application/json; odata=verbose" },   success: successHandler,   error: errorHandler }); When we try this, we get 400 error (Bad request). So what is the correct way of making it work? You need to pass the relative URL of the document library not just ...