Skip to main content

Posts

Business Data Connectivity

I came to a requirement wherein I was supposed to get data from an 3 rd party portal using API’s and then bring them to SharePoint server. The first approach that I finalized was just to make BDC solution that will get data from 3 rd party portal and will deploy it to SharePoint. How to Create BDC solution in SharePoint? I found below link that is having really great description about hot to create and deploy the BDC solution to SharePoint. http://www.c-sharpcorner.com/uploadfile/hung123/creating-business-data-connectivity-service-using-visual-studio-2010/ After creating an POC I came to know that BDC model cannot be deployed on Multi tenant farm. So what can be done next? After some amount of googling I came to know that we can create BDC solution using WCF services also. So I created a WCF service solution that acted as a wrapper that used to fetch data from the portal. We can them publish that service to IIS or Server and use the servic...

Execute custom code after SharePoint List/Library default events (Sort/filter/ Taxonomy Key filter etc.) are fired

Today I came to build a jQuery solution that was supposed to do some text replace operation on SharePoint’s default list views. At first glance the task looked so easy that it can be implemented in a while. After the task was implemented the first issue that I noticed was when you apply filter the SharePoint List/Library the script didn’t do its task. The reason was that when any SharePoint default event like filter, sort or a taxonomy key filter are fired the page is partially posted back. So in order to make your jQuery work with such cases you need to enable your code to get executed when the SharePoint events are fired. Below is the method I which you can place your code and the code will get executed after SharePoint’s default events are fired. SPClientTemplates.TemplateManager.RegisterTemplateOverrides({ OnPostRender: function(ctx) {                 //Your code to be executed after the...

SharePoint Migration : This content database has a schema version which is not supported in this farm

Today one of my client was expecting to restore a SharePoint Site Collection from and Database that he already took as a backup.  I followed below steps.           1.        Imported content database to SQL of the farm where the site is to be restored.           2.        Created a web application.           3.        Visited manage content database, set the current database property to offline.           4.        Click on add a new content database.           5.        Set the name of the content database same as the database that is imported to SQL.   SharePoint gave me below error. “ This content database has a schema version which is not supported in this farm." I tried to use powershe...

Add a custom button to Document Library Items

Recently I created a jQuery add-in that was supposed to add a custom button to each document in the document library. I found 2 different approaches for the same.             1.        Edit XML of the document library in designer.             2.        Create a J Query add-in that would add a custom button. I found Approach 1 to be easy to do but it was risky to modify the XML of the Document library. So the only option that I was left with was to create a j Query add-in. There can be number of requirements for which you may need to add a custom button to document library, lets take an example of adding a custom download a copy button to each item of document library. Below is the code sample that will add a download a button link to your document library <script type="text/javascript" src="//ajax.googleap...

Query SPList’s view, create HTML schema and render on page.

Normally we come across a requirement where we need to provide SharePoint List like UI and facilities to user in our solutions. I came across a good solution where in we query a view of SharePoint List, generate a new custom view and instead of updating default view we just copy the schema HTML and render it to page. It provided me many advantages compared to using SPGrid and writing down code to handle sorting, filtering, paging and many more. The best part I found is Multi column filter and sorting is handled by SharePoint itself. No issues related to paging or UI. Even though I have not tested below solution to extremes, but found it great so decided to document it. Below are solution steps. Create an empty SharePoint Project.   Add a blank webpart to the project.   Create few global properties in the webpart code file. private string listName = "TestList1" ; private string viewFields = "ID,test1,test2,test3" ; private stri...