Skip to main content

Posts

Showing posts from 2017

Site collection Feature Activation using CSOM Code.

Site collection Feature Activation using CSOM Code.    public static void ActivateFeature(string webFullUrl, Guid featureId, bool force, FeatureDefinitionScope featdefScope)         {             try             {                 using (var ctx = new ClientContext(webFullUrl))                 {                     var features = ctx.Site.Features;                     ctx.Load(features);                     ctx.ExecuteQuery();                     features.Add(featureId, force, featdefScope);                     ctx.ExecuteQuery();         ...
Error : Attach database failed for Server […] Unable to open the physical file “[…]”. Operating system error 5: “5(failed to retrieve text for this error. Reason: 15105)”. (Microsoft SQL Server, Error: 5120) Soultion: SQL Management studio -> Run as Admin and tried its started working

SharePoint 2013 JQuery Datatable View

SharePoint 2013 Datatable View Add the following code in Script Editor <script src="https://code.jquery.com/jquery-1.11.3.min.js" type="text/javascript"></script>  <script src="https://cdn.datatables.net/1.10.9/js/jquery.dataTables.min.js" type="text/javascript"></script>  <link rel="stylesheet" href="https://cdn.datatables.net/1.10.9/css/jquery.dataTables.min.css" type="text/css" /> <script type="text/javascript">    $(document).ready(function () {    alert('test');       $('.ms-listviewtable').dataTable({              });     });  </script> 

Expand ALL & Collapse ALL in Sharepoint Library Group View

 <input type="button" value="Expand ALL" onclick="ProcessAll(this)"  style='color:white;background-color:darkgreen;font-weight:bold;'/> <script> function ProcessAll(btnobj) { if(btnobj.value=="Expand ALL") { expandAllData(); btnobj.value="Collapse ALL"; } else { collapseAllData(); btnobj.value="Expand ALL"; } } function  expandAllData() { $("img.ms-commentexpand-icon").click(); } function  collapseAllData() { $("img.ms-commentcollapse-icon").click(); } </script>

Clear Your SharePoint Designer 2010/2013 Cache

Procedure: Close SPD if it is open   Open My Computer   a.Click the address bar   Paste in: %USERPROFILE%\AppData\Local\Microsoft\WebsiteCache   Delete everything within this location   Click the address bar   Paste in: %APPDATA%\Microsoft\Web Server Extensions\Cache   Delete everything in this location SharePoint Designer 2010 and 2013 Navigate to the "File" menu then select "Options" -> "General" -> "Application Options". On the “General” tab, under the “General” heading, uncheck “Cache site data across SharePoint Designer sessions”.

Validate Current user Belog to Member of the Groups

 public bool VaildateUserBelogtoGroups(string[] groupNames)         {             bool rval = false;             try             {                 foreach (string grpName in groupNames)                 {                     SPGroup ogrp = SPContext.Current.Web.SiteGroups.GetByName(grpName);                     if (ogrp.ContainsCurrentUser && rval == false)                         rval = true;                 }             }             catch (Exception ex)             {     ...

Show Sharepoint Ribbon on page Load

<script> setTimeout(function() { var elem = document.getElementById("MSOZoneCell_WebPartWPQ2"); if(elem != null) { var dummyevent = new Array(); dummyevent["target"] = elem; dummyevent["srcElement"] = elem; WpClick(dummyevent); } }, 100); </script> The above script will invoke the ribbon by default in IE( for the specific webpart), incase if you added multiple webparts.

Task List Not Showing in Add an App

Today i found that one of the Sub site is missing the Task List in Add an APP. i am searching the root cause nothing i found Then i decided to search on Site Features, there i found Team Collaboration Lists - This Feature i Deactivated and Activated then its Showing Now... :) Hope this may helps someone.

Filter and Paging For SharePoint Library

Create Calculated Column "FN" Formula =UPPER(LEFT([Title])) Edit  all items view page -> add the following script in Script editor. <script type="text/javascript">     function qs(paramName) {         var args = document.location.search.substring(1).split("&");         for (j = 0; j < args.length; j++) {             nameValues = args[j].split("=");             if (nameValues[0] == paramName) return nameValues[1];         }         return null;     }     var filterField = "FN";     var filterValuesDelimiter = " - ";     var filterValues = new Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X...

SharePoint 2013 Tab Pages

Tab-Pages : http://www.ashokraja.me/post/Easy-method-to-convert-a-SharePoint-2013-Content-Editor-WebPart-into-Tab-Pages.aspx http://www.ashokraja.me/post/Tab-Pages-WebPart-in-SharePoint-2013-based-on-jQuery-Easy-Tabs-without-combining-multiple-web-parts.aspx

CSS Effects & Animation

Gradient Effect using CSS https://testdrive-archive.azurewebsites.net/Graphics/CSSGradientBackgroundMaker/Default.html Image Roll Over Effect http://aceinfowayindia.com/blog/ace-tuts/css-rollover.html CSS Animations http://www.the-art-of-web.com/css/css-animation/ CSS: border-radius http://www.the-art-of-web.com/css/border-radius/

how to set any SP.Field Value with JSOM (Javascript) Sharepoint 2013

function createListItem() { var clientContext = new SP.ClientContext(_spPageContextInfo.siteAbsoluteUrl); var oList = clientContext.get_web().get_lists().getByTitle('TestList'); var itemCreateInfo = new SP.ListItemCreationInformation(); this.oListItem = oList.addItem(itemCreateInfo); //Single line of text oListItem.set_item('Title', 'My New Item!'); //Single Choice oListItem.set_item('PetkaChoiceDrop', 'Enter Choice #1'); //Multi Choice var petkaChoiceMultiArray = new Array("Enter Choice #1","Enter Choice #2"); oListItem.set_item('PetkaChoiceMulti', petkaChoiceMultiArray); //Single Lookup var PetkaLookupSingle = new SP.FieldLookupValue(); PetkaLookupSingle.set_lookupId(2); oListItem.set_item('PetkaLookup', PetkaLookupSingle); //Multi Lookup var lookupsIds = [1,2]; var lookups = []; for (var ii in lookupsId...

Why SharePoint Online is a much smarter choice than SharePoint On-Premise!

Security, is way tighter in SPO infact – and some features do not even exist in SP On-Premise. For instance, with SPO: 1.      You get the ADFS integration – which means, you can take advantage of the ADFS features & security policies, location based control for SPO as well 2.      RMS – Rights Management Services – Azure RMS – is pre-configured in SPO and supports file types such as MS Office, PDF files, Images too – and all you need is the Azure Information Protection Client to view the protected files 3.      You get DLP (Data Loss Prevention) which is only available with SPO and I have created a presentation for this here – Have a look and using this, we can prevent confidential content such as documents containing patents, SSN numbers or SWIFT Codes or IP Addresses can be protected from going out 4.      SPO Content has multiple times encrypted and hence, the content is way secure t...