Showing posts with label javascript:;. Show all posts
Showing posts with label javascript:;. Show all posts

Wednesday, March 30, 2016

Configuring Auditing in SharePoint 2010

In this below script, Configuring Auditing in SharePoint 2010

Configuring Auditing in SharePoint 2010

  • Go to site Settings
  • select Site collection Administration
  • Choose Audit log Reports
  • Delete Deletion
  • Please the save location 
  • I'll save this report to the Shared Documents Library, however in production this is where I create a document library with unique permissions so only Site Collection Administrators can see the contents. I click on Browse.
  • View Report 
  • You ll get excel report format

Tuesday, March 29, 2016

How to get current master page and change it on the Site using javascript

 GET request

/_api/Web?$select=CustomMasterUrl,MasterUrl

function MastePageChange() {
    var clientcontext;
    var cweb;
    var customMasterURL = '/_catalogs/masterpage/NewMasterPage.master';
    clientcontext = new SP.ClientContext.get_current();
    cweb = clientcontext.get_web();
    cweb.set_customMasterUrl(masterPageUrl);
    cweb.set_masterUrl(masterPageUrl);
    cweb.update();
    clientcontext.executeQueryAsync(function() {
        alert("Master Page has been changed successfully \n" + customMasterURL);
    }, function(sender, args) {
        alert("Error: " + args.get_message());
    });
}

MastePageChange();

How to set SharePoint list view 'Item Limit' with the option programmatically

Limit the total number of items returned to the specified amount



ClientContext clientContext = new ClientContext("http://hercules");
          clientContext.Credentials = new NetworkCredential("Peakfinder", "password@1");
          string listName = "Employess", viewName = "All Items";          
          bool paged = true;      
          List list = clientContext.Web.Lists.GetByTitle(listName);
          View view = list.Views.GetByTitle(viewName);
          view.Paged = paged;
          view.Update();
          clientContext.ExecuteQuery();

How to change SharePoint list field color using jquery code base on value?

In this below script, hange SharePoint list field color using jquery code

change SharePoint list field color
 $("table.ms-listviewtable > tbody > tr > td:nth-child(columnNumber) > div").filter(function() {
        ( parseInt( $(this).text() ) > 59 ) ? $(this).css("background-color", "#00FF66") : null  
    });

Calculating date value based on a column value Using SharePoint Workflow

In this below script, oCalculating date value based on a column value SP

Calculating date value based on a column value
=IF(A<1/3/2016,A+100,A+50)
Set the column to return date.