Sunday, June 28, 2015

Create List View by filtering Month in SharePoint

Create a calculated filed with
=YEAR(Created)&"-"&CHOOSE(MONTH(Created),"01. January","02. February","03. March","04. April","05. May","06. June","07. July","08. August","09. September","10. October","11. November","12. December")

http://guru-web.blogspot.ae/2006/02/some-of-my-favourite-date-wss-list.html

Monday, June 15, 2015

OData query operations in SharePoint 2013 Online REST requests

Scenario: Get the employee(logged user) leave balance
var userId = _spPageContextInfo.userId;
  //Retrive the leave balance of the current user--Start
  $.ajax({
   
        url:_spPageContextInfo.webAbsoluteUrl + "/_api/lists/getbytitle('Leave Balance')/items?$select=Balance&$filter=(EmployeeId eq '" + userId + "') ",
        method: "GET",
        headers: { "Accept": "application/json; odata=verbose" },
        success: function (data) {
//alert(data.d.results[0].Balance);
if(data.d.results.length>0)
$( "input[id*='Balance']" ).val( data.d.results[0].Balance);
 else
 $("
There is issue to retrieve the leave balance. Please contact HR!
").dialog();
        },
        error: function () {
            $("
There is issue to retrieve the leave balance. Please contact HR!
").dialog();
        }
    });
  //Retrive the leave balance of the current user--End
Ex1:
var URL1=_spPageContextInfo.webAbsoluteUrl + "/_api/lists/getbytitle('LeaveRequests')/items?$select=Title&$filter=(Title eq '"+user.full_name+"' and ((Approval_x0020_Status ne 'Cancel') and  (Approval_x0020_Status ne 'Approved') and  (Approval_x0020_Status ne 'Rejected')))";


Thursday, June 11, 2015

SPEasy Form for SharePoint List customization.

Customizing list form is part of daily job. Got a new tool over internet to customize the form in a simple way.
Have a look @ http://speasyforms.com/