Showing posts from 2016

SharePoint 2013 Search =>Increase CutoffMaxBuckets size of the refiner

As we know by default refiner cut off max bucket size is 1000. So what if some time we as the developer wanted to increase it or having a requirement where we have more than 1000 refiners values.

In this scenario, if you want to increase the size of the refiner you need to update the managed property by using the following powershell command.
RefinerConfiguration CutoffMaxBuckets Property
Full PowerShell code download from Github gist.

SharePoint 2016 JavaScript framework

Now As you know SharePoint 2016 JavaScript framework totally based on following technologies. you can create JavaScript web part based on following technologies.
NodeJS (nodejs has npm:- package manager tool which helps developer to Find, share, and reuse packages of code from hundreds of thousands of developers — and assemble them in powerful new ways) TypeScript Yeoman (Provide scaffolding tool for modern webapps , same Visual studio has templates example website, SharePoint project) Gulp/Grunt (Task automation tool based on JS framework, will help you run the workflow example, generate your builds) Angularjs/Reactjs/Ploymerjs  All above technologies based on "JavaScript". Microsoft developed on free tool called "Visual Studio Cod"e is a code editor redefined and optimized for building and debugging modern web and cloud applications.

To connect with updates please check the Microsoft PNP page

I have created Mean stack …

SharePoint 2013 Search Center In Iframe

While placing the search center URL in Iframe , we got the following issue known issue(cross domain issue. )
Chrome Console error

IE Error message To fix this issue we need to do the following steps.Add this line in you custom Master Page.<meta http-equiv="X-Frame-Options" content="allow" />
Add the following line your layout page. The following tells SharePoint to allow this page to be hosted in an IFrame<WebPartPages:AllowFraming runat="server" />

After done with the above changes you will face one more issue in IE, i.e. when you click the search vertical, Unfortunately, init.js throws an exception in this context (as it tries to access window.frameElement, which belongs to the other domain). MSDN mentioned same issue.

To fix this issue you need to override the existing code using the monkey patch in JavaScript as discussed in this post.
To fix this issue either you can place the below mentioned code in Script Editor or placed JavaScript file…

Send Email using SharePoint Rest API

We have a requirement to send email vai SharePoint Rest API. We dig and find the below solution to send email using SharePoint API.
Point Must be remember End point "/_api/SP.Utilities.Utility.SendEmail" end point to send email. In JSON __metadata we used the type "SP.Utilities.EmailProperties".The User / Group must have a read permission for particular site. where we placed this site code. JS Dependency JQuery
Code URL:
Code varEmail=function(){// Email Either email groupname or email addressvarfrom='', to ='', cc ='', subject='My Email Subject'; this.options=this.options|| {};

Search Control Template with page size drop down

In OOB control template there is only 10 results per result able to view to the end user. The functionality would be handy if we provide such type of end user to change the result size itself.   

So the idea just place on drop-down at the top of the search result, when user changes the drop down it will change the size of the page.
To implement, we would require change the “Control_SearchResults.html” template only

Following are the steps to implement drop down in Control Search results.
Navigate to the search centerMap “<server:Port>\_catalogs\masterpage\Display Templates\Search”.Edit Control_SearchResults.html template.Look for <div id="Control_SearchResults"> div at the top of the div placed the below mentioned code.<!--#_ Type.registerNamespace('search.Results'); search.Results = function() { return { loadMoreResults: function (value) { // Loading more results ctx.DataProvider.set_resultsPerPage(value); ctx.DataProvider.issueQuery(); } } }();