Posts

Calculate financial year start and end date SQL Server

DECLARE @year INT = 2012 SELECT STDATE = DATEADD ( MONTH , 3 , DATEADD ( YEAR , DATEDIFF ( YEAR , 0 , DATEADD ( YEAR , @year - 1900 , 0 )), 0 )), ENDDATE = DATEADD ( DAY , - 1 , DATEADD ( MONTH , 3 , DATEADD ( YEAR , DATEDIFF ( YEAR , 0 , DATEADD ( YEAR , @year - 1900 , 0 ))+ 1 , 0 )))

Overview of the SharePoint Framework

https://dev.office.com/sharepoint/docs/spfx/sharepoint-framework-overview 

SharePoint 2013 suite bar

Method 1 $('div#suiteBarLeft .ms-core-brandingText').html("<span>Your preferable name</span> "); Method 2 .ms-core-brandingText:after{ content:"Your preferable name"; } .ms-core-brandingText{ margin-left: -90px; }

Rest API Call - Multiple SharePoint List

function GetListItems() {     function getJsonDataAsync(url) {               return $.ajax({             url: url,             method: "GET",             contentType: "application/json",             headers: {                 accept: "application/json;odata=verbose"             }         });     }     var ListData1 = _spPageContextInfo.webServerRelativeUrl + "/_api/lists/GetByTitle('listname1')"     var ListData2 = _spPageContextInfo.webServerRelativeUrl + "/_api/lists/GetByTitle('listname2')"         var response1= getJsonDataAsync(ListData1);     var response2= getJsonDataAsync(ListData2);           jQuery.when(response1, response2...

SharePoint 2013 "_spUserId" is undefined

_ spUserId is deprecated in SP2013. Use _ spPageContextInfo.userId instead.

SharePoint List : Check if the user has attached file

​​<script type="text/javascript" language="javascript"> function PreSaveAction() {     var attRow = document.getElementById("idAttachmentsTable");     if (attRow == null || attRow.rows.length == 0) { document.getElementById("idAttachmentsRow").style.display='none'; alert("Please attach the file. Attachment is mandatory"); return false ; } else { return true ;} } </script>​

SharePoint Form Digest

Form Digest Form Digest is used to insert a security validation for SharePoint pages. The digest value will be created by SharePoint server during page creation. Example:  A user loads a SharePoint page. He injected a script which updates the list data. When the user posts the page, the server will check Form Digest value against the page content. Thus, security attacks can be prevented. Viewing Form Digest You can use the view-source of a SharePoint page to see the form digest value. The value is stored under name  ___REQUESTDIGEST .