Total Pageviews

1 Oct 2015

Target SharePoint layouts pages with CSS

/* This will find MyID and hide it only on layouts pages */
form[action^='/_layouts/'] #MyID{
 display:none;
}

SPList.NeedUpdateSiteClientTag property

SPList.NeedUpdateSiteClientTag  is a boolean value that determines whether to editing documents in this list should increment the ClientTag for the site. The tag is used to allow clients to cache JS/CSS/resources that are retrieved from the Content DB, including custom CSR templates


When an item in this list is modified, the application file cache version for the site that contains this list MUST be updated.


MSDN

3 Sep 2015

Encode and decode field names from display name to internal name

Encode and decode field names from display name to internal name

Credits to Stefan Bauer


private string DecodeInternalField(string toDecode)
{
    if (toDecode != null)
    {
        string decodedString = toDecode.Replace("_x", "%u").Replace("_", "");
        return HttpUtility.UrlDecode(decodedString);
    }
    else
    {
        return null;
    }
}

1 Jul 2015

SharePoint Ports

Here is a quick link with most of the ports that might be used by SharePoint:

http://www.sharepointdiary.com/2010/04/ports-used-by-sharepoint.html

SharePoint has to communicate with other servers such as Active Directory, DNS etc which require other ports, they are as follows:
  1.     AD Authentication: TCP:445 Kerberos :TCP:88
  2.     LDAP:  LDAP:389 and LDAPS:636
  3.     DNS: TCP:53
  4.     SMTP: TCP:25
  5.     SQL Server: TCP:1443 (or Custom Ports)
  6.     Server Message Block (SMB) TCP:445 or TCP:137,138,139 (over NetBIOS).
    • is used extensively for search and query operations with SharePoint
  7.     HTTP/HTTPS:  TCP:80 or TCP:443 (SSL)
  8.     Office Server Web services /Shared Service Provider web service calls: 56737 and 56738 (SSL).
  9.     Open TCP port 135 plus ports in the range that you specify when you configure static RPC (only if using SSO).
  10. Service Applications use: 32843,32844 & 32845 (TCP EndPoint)
  11. User code Service: 32846
  12. User Profile Sync: 5275

Credits to Salaudeen Rajack

23 Apr 2015

Override Keyboard Keys in SharePoint

Here is a simple way to override keyboard keys in SharePoint:


 overrideKeys = function () {  
 /*This is a standard SharePoint Function, that listens to keyboard events*/  
   window.OnListViewKeyDown = function OnListViewKeyDown(a, b) {  
     var d = GetListContextFromContextNumber(String(b));  
     if (d == null || d.inGridMode) return;  
     var e = a.keyCode,  
       c = a.shiftKey || a.ctrlKey;  
     if (IsCallOutOn()) return;  
           console.log(e);  
     switch (e) {  
       case Sys.UI.Key.del:  
         //Oveeride Delete Button  
         break;  
       case Sys.UI.Key.up:  
         SelectNextRow(b, -1, c, a);  
         break;  
       case Sys.UI.Key.down:  
         SelectNextRow(b, 1, c, a);  
         break;  
       case Sys.UI.Key.enter:  
         if (IsEventTargetAnchor(a)) return;  
         if (a.target != null && !IsStrNullOrEmpty(a.target.className) && a.target.className.indexOf("ms-lstItmLinkAnchor") >= 0) OpenCallOutOrECB(b, a);  
         else ListItem_Open(b, a)  
           case Sys.UI.Key.esc:  
                 //override Esc  
                 brea;  
     }  
   }  
 };  
 $(function () {  
   setTimeout(overrideKeys, 600);  
 });  
You can have a look at the full list of Sys.UI.Keys here

17 Mar 2015

Hide SharePoint 2013 Controls on Full Screen Mode

How do I hide or Show custom controls in full scree mode?




When you click on "full screen mode" button ms-fullscreenmode  class is added to the <Body> tag:



Solution:


A sample snippet of CSS that will hide your controls in full screen

/*hide controlID div only when full screen mode is enabled/
.ms-fullscreenmode #controlID {
 display:none;
}


#controlID - id of an HTML element that should be hidden when "full screen" is clicked