Skip to main content

Posts

Showing posts from April, 2016

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 solution in

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