Thursday, April 20, 2017

Rename a Web Application in Sharepoint : A solution using powershell


Here is a small script that will enable you all to change a SharePoint Web Application name .



We can use the following SharePoint PowerShell script:





$renameWApp=Get-SPWebApplication | where {$_.Name -match "Old Web Application Name"}
$renameWApp.Name="New Web Application Name"
$renameWApp.Update()

Want to delete more than 5000 items in a sharepoint list : a better way is here

Its a very common issue that you face, to delete bulk data from a SharePoint list (above 5000) .

Everyone would run into the error  : Sorry Something went wrong



Tried deleting from SharePoint designer too , it did not help ...


After hours of trial and error found out something cool for this : MICROSOFT ACCESS to the rescue :
Open Access
1. create a blank database.
2. go to External Data and in the Import & Link section Choose SharePoint List
3. Connect to the SharePoint list

4. Click Next, and choose the list you want to work with . Click OK.

 Open the table ,select any items you want to  edit or delete.


Thats it ...

Tuesday, August 30, 2016

Sharepoint : Get list item Attachment by Name using JSOM

Scenario : Suppose you want to get the attachment from a list item and you only know its name .



Solution :You can achieve this using a simple JSOM code as shown below . the major player in this code is the line "splistItem.get_attachmentFiles().getByFileName("FILENAME"));"




function getAttachmentsDetails()
{

var clientContext = SP.ClientContext.get_current();
var splist = clientContext.get_web().get_lists().getByTitle("LISTNAME");
var splistItem = splist.getItemById(ID);
clientContext.load(splistItem);

// gets the item by attachment file name
clientContext.load(splistItem.get_attachmentFiles().getByFileName("FILENAME"));


clientContext.executeQueryAsync(Function.createDelegate(this, Success), Function.createDelegate(this, Fail));
 
function Success(sender, args) {
    var attachitem = splistItem;
    var total = attachitem.get_attachmentFiles().get_count();
    if (total > 0) {
        console.log(total + " file attachments"); // count will give the attachment count
    }      
}
 
function Fail(sender, args) {
    //failed function
}
}
That's All! SharePoint All the Way !!!


Monday, August 8, 2016

JavaScript : Format Data to MM-DD-YYY hh:mm AM/PM

A simple function to format date in MM-DD-YYY hh:mm AM/PM  format.


Usage :  DateFormatter(Datevalue)


// Function that formats date
function DateFormatter(dateValue) {
    var newDate = new Date(dateValue);
    var sMonth = AdjustDate(newDate.getMonth() + 1);
    var sDay = AdjustDate(newDate.getDate());
    var sYear = newDate.getFullYear();
    var sHour = newDate.getHours();
    var sMinute = AdjustDate(newDate.getMinutes());
    var sAMPM = "AM";
    var iHourCheck = parseInt(sHour);
    if (iHourCheck > 12) {
        sAMPM = "PM";
        sHour = iHourCheck - 12;
    }
    else if (iHourCheck === 0) {
        sHour = "12";
    }
    sHour = AdjustDate(sHour);
    return sMonth + "-" + sDay + "-" + sYear + " " + sHour + ":" + sMinute + " " + sAMPM;
}


//function that pads the values
function AdjustDate(value) {
    return (value < 10) ? "0" + value : value;
}


// Code ends here




SharePoint all the way !!!

What to expect in Sharepoint this Year : ?


I was just reading through the office Blogs this morning and some words in that made me feel super excited . Just thought , I would share a summary of things to expect for the SharePoint users in the year of 2016 .


The following are the functionalities that will be rolled out from Microsoft this year :
  • Access to SharePoint Online document libraries and Office 365 Group files from the OneDrive mobile app.
  • Intelligent discovery of documents from both OneDrive and SharePoint.
  • Copy from OneDrive to SharePoint in the OneDrive web experience.
  • OneDrive Universal Windows Platform (UWP) application.
  • Document analytics surfaced in OneDrive to provide insight into document usage, reach and impact.
  • Synchronization of SharePoint Online document libraries with the new OneDrive sync client.
  • Synchronization of shared folders with the new OneDrive sync client.
  • Mobile access to SharePoint document libraries in on-premises farms.
  • Move and copy files between OneDrive and SharePoint in web experiences.
Reference : https://blogs.office.com/2016/05/04/the-future-of-sharepoint/


Already Excited and Just cant wait :) .... SharePoint all the way !!!!1

Sharepoint 2016 : Team Sites Gets an Upgrade and it looks awesome..

Fresh Look, Change in Logic  and cool things that makes it fabulous
Microsoft have made some changes to the look and feel , and logic of SharePoint 2016 team sites .  when a site is created from the “SharePoint home” page you’ll actually be creating an Office 365 Group *and* a team site together.  That is a major change to the previous logic of One drive .
The following images shows the new look UI for the team sites .
 

 
 
  • So these modern team sites will be a collaboration of  SharePoint team sites and Office 365 Groups together.
  • Every group will have a  team site associated with it .
  • Moreover this will have a fresh look and feel as shown in the image above.

  SharePoint all the way...

Sharepoint FrameWork 2016 : A new baby is born



In the Month of May 2016 , Microsoft Announced- a new development  model for SharePoint . It has been given the name SHAREPOINT FRAMEWORK . Consider it as a modern development kit that is flexible , enhancable, robust  and that embraces Microsoft’s “mobile-first,
cloud-first”  terms.


This new baby  focuses on client-side rendering framework leveraging open source JavaScript technologies. This will allow developers to use modern JavaScript and web templating frameworks across cloud and on-premises SharePoint.


The Framework is built on top of a collection of frameworks, libraries and techniques that you want to be comfortable with before you begin work with the Framework. In particular, the Framework makes use of JavaScript-based client-side rendering (CSR), and in fact the development framework, the Workbench, is built on top of Node.js, a JavaScript-based application runtime environment. The Framework makes use of an array of open-source tools that have been becoming standard for any web-based project.


Tools needed for us to be prepared :
1. JavaScript  : Client side code/library
2. Node.js   : is a network application runtime environment
3. Yoeman  :  another Node.js-based tool that allows you to quickly scaffold a project
4. Gulp  :  Gulp is a task-runner based on Node.js
5. React.js : a rich framework for building web applications
6. Visual Studio Code : an open-source code editor built by Microsoft
7. GIT
8. TypeScript : Strong Typed JavaScript




Expected Release :


The SharePoint Framework will be released to Office 365 customers in First Release this summer. Web parts built with the framework can be added to modern pages and experiences and to existing pages.


  • The Files API on Microsoft Graph.
  • SharePoint Webhooks (preview).
  • Client-side web parts for existing pages (preview).
  • The Sites API on Microsoft Graph.
  • SharePoint Webhooks (GA).
  • Custom sites on the SharePoint Framework.
References : https://blogs.office.com/2016/05/04/the-future-of-sharepoint/


Together , let us be ready to welcome this new baby of ours.


SharePoint All the Way !!!!

Rename a Web Application in Sharepoint : A solution using powershell

Here is a small script that will enable you all to change a SharePoint Web Application name . We can use the following SharePoint Pow...