Posts

Showing posts from 2016

Updating Excel data to Share Point List Items based on Id

Loading Excel Data  public void LoadExcelData()         {             string fileName = "D:/Employee.xlsx";                     string fileExtension = Path.GetExtension(fileName).ToUpper();             string connectionString = "";             if (fileExtension == ".XLS")             {                 connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" + fileName + "'; Extended Properties='Excel 8.0;HDR=YES;'";             }             else if (fileExtension == ".XLSX")             {                 connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" + fileName + "';Extended Properties='Excel 8.0;'";                 //string connString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\source\\SiteCore65\\Individual-Data.xls;Extended Properties=Excel 8.0;HDR=YES;";             }             if (!(string.IsNull

Deleting Share Point list Items using powershell.

Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue try {      $web = Get-SPWeb "http:/Testurl/sites/Feedback/"    $list = $web.Lists["Survey"]    $caml='<Where><Eq><FieldRef Name="Month" /><Value Type="Text">June</Value></Eq></Where>' $query=new-object Microsoft.SharePoint.SPQuery $query.Query=$caml $col=$list.GetItems($query) Write-Host $col.Count $col | % {$list.GetItemById($_.Id).Delete()} $web.Dispose() } catch { write-host $_.exception } Hope... This code will help you...

Hosting Options for the SharePoint 2013 App Model

SharePoint Hosted:  A SharePoint-hosted app is one that contains no server-side components. Everything that it needs to function, such as lists, libraries, etc., it is able to deploy within the SharePoint environment. Provider Hosted:  A Provider-hosted app is one that has server-side components. These components are usually contained within an ASP.NET application and you have to provide a separate environment to host them. These server-side pieces can be developed in any technology as long as you can leverage OAuth and make REST calls. Auto-Hosted:  An Auto-hosted app runs on Office 365 and its SharePoint Online offering. Like a provider-hosted application, an auto-hosted app has server-side components, but when you deploy the app to SharePoint, the service fires up the server-side elements in an Azure layer. App Scope An app for SharePoint has an app scope. The two possible app scopes are  web scope  or  tenant scope . The difference is not a property of the app, and you

Understanding HTML master pages in SharePoint 2013

With Design Manager in SharePoint 2013, you can convert an HTML file into a master page file. Once the conversion was successful from then the html and master page files are associated with each other. Which means if you do any edits to the html file, master page file will be automatically updated. If you have an HTML file available with you, you can directly upload the file by going to the Site Settings -> Design Manager -> Edit Master Pages -> Convert an HTML file to a SharePoint master page. Once you have uploaded the HTML file, you will see an option from context menu to convert the file to master page. Once the conversion completed the status field will be updated to either “Warnings and Errors” or “Conversion Successful” with clickable link which points to the preview of the master page. While creating an HTML master page in SharePoint 2013 these are the important points you should remember: XML Compliant : HTML file should be XML-complaint. But, there are some e

How to Enable ECB menu on custom column in SharePoint 2013?

Image
In this post we will discuss how to enable ECB menu on custom column in SharePoint 2013. By default the ECB menu comes for the Title column where user can click on the ECB menu to do some operations like Edit Item, View Item, Workflows, Delete Item etc. See the fig below: But here one of our requirement is to add the ECB menu into a custom column. I have a custom list where in the Title column the ECB menu is there by default but I wanted to put the ECB menu in a custom column name as First Name. We can do this by using SharePoint designer. Open your site in SharePoint 2013 designer and then click on the particular list for which you want to do. This will open the settings page for the list. From the Views section click on the particular view (All Items).  This will open the code view and there search for <View> tag and within that <ViewFields> and then find the particular column for which you want to add the ECB menu and then add ListItemMenu="TRUE&qu

Hide Save button in New and Edit form in SharePoint 2013 list

Image
Hide Save button from New Edit form We have a SharePoint list where we have customized the input form using InfoPath. And in that customized InfoPath form we have a custom Save button and we are saving the item from the default data connection. This button also has some validation rules. So we do not want any user to insert an item by clicking on the Ribbon Save button. They should only be able to save through our Submit button which was presented inside the InfoPath form. You can disable the Save button from the InfoPath form submit properties. But we do not want to show the Save button at all. Be default the submit button appears like below:  We have written the JavaScript and css code to hide the Save button. For this Edit the page and then Insert a Script editor web part into it. Then write the below code inside the script editor web part and Save the page. <script type="text/javascript">     function hideEdit() {         var edit = docum

SharePoint 2013 Keyword Query (KQL) Content Class Property Restrictions

Using property restrictions in your KQL queries, you can restrict your search to only pull back certain things like calendar events for instance. This is a very powerful way to limit search results  and get exactly what you are looking for. You can use these in your query like this: " lunch contentclass:STS_ListItem_Events " This will return only calendar events with the word "lunch" in them.  Pretty powerful and pretty simple. Here is a list of available content class items: STS_Site –  Site Collection STS_Web  –  Site (Web) STS_List_850  –  Page Library STS_ListItem_850  –  Page STS_List_DocumentLibrary  –  Document Library STS_ListItem_DocumentLibrary  –  Document Library Items STS_List  –  Custom List STS_ListItem  –  Custom List Item STS_List_Links  –  Links List STS_ListItem_Links  –  Links List Item STS_List_Tasks  –  Tasks List STS_ListItem_Tasks  –  Tasks List Item STS_List_Events  –  Events List STS_ListItem_Events