Add prefix to the phone no column in SharePoint using JavaScript/JQuery

In this article we are able to see how to add prefix to the phone no in SharePoint list column using JavaScript.
enter only numbers in text box in SharePoint
Generate unique id in SharePoint using jQuery/JavaScript 
How to populate today’s date using JQuery in SharePoint
We are having a column with name Phone no, whenever we enter the number in that text box, once we click on save button, in the display form we can able to see the value like Call:987XXX3210.
We adding extent Call prefix before the Phoneno, we writing the code in PreSaveAction.

function PreSaveAction(){

try
{

var pno= document.querySelector('input[title^="Phoneno"]').value;
if(pno=="")
{

}
else
{
pno = pno.indexOf("Call:")==-1 ? 'Call:'+pno : pno;
$('input[title^="Phoneno"]').val(pno);
}
}
catch(e)
{
alert("error on save :"+e.message);

}
return true;
}


Reduce one day in SharePoint list Column using PowerShell

In this article we can able to see how to reduce one day less for a particular date column in SharePoint list using PowerShell.


Copy data from one list to another list in SharePoint using PowerShell
We migrated the content from lotus notes to SharePoint, due to some time Zone difference we got one last more for all the items in the list. For that using PowerShell we reduced the one day.
  
Add-PSSnapin microsoft.sharepoint.powershell
$spWeb = Get-SPWeb "http://dotnetsharepoint.com/sites/sharepoint"
write-host $spweb
$List=$spWeb.Lists["ListName"]

write-host $lList
$spItems = $List.GetItems()

foreach($spItem in $spItems)

{

    $datevalue = $spItem["DateColumnName"].AddDays(-1);

$spItem["DateColumnName"] = $datevalue
$modifiedBy = $spItem["Editor"]
$modifieddate = $spItem["Modified"]
$spItem["Editor"] = $modifiedBy
$spItem["Modified"] = $modifieddate
$spItem.Update()
$list.Update()
 }
SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

Could not save the list changes to the server SharePoint designer 2013

In SharePoint Designer  2013 we are trying to create a custom new form, while we trying to create we are getting an error  “Could not save the list changes to the server”, we closed the designer and opened again even though we are getting the same issue.


We access the SharePoint site and navigated to the particular list setting there we are able to see the threshold limit is increased, we identified this may be the root cause so we ran a PowerShell script to bypass the threshold limit.

Check the below URL



Now we are able to create “New Form” in the Designer without any issues.

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

Disable list throttling SharePoint using PowerShell

In some cases we have to handle large amount of list items with more than 50,000 items, instead of changing the threshold at farm level, we can bypass the limit at list level for that we can use PowerShell script.

$web give the sitecolection/site Url and $list give the list display name that you want to disable the limit.

For disabling we are $list.EnableThrottling = $false
If you want to enable it again we can change it to $list.EnableThrottling = $true


Add-PSSnapin Microsoft.SharePoint.PowerShell
$web = Get-SPWeb http://dotnetsharepoint.com/sites/sharepoint/
$list = $web.Lists["SharePointList"]
write-host $list
$list.EnableThrottling = $false
$list.Update()


SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

Set cursor in textbox on button click in SharePoint using jQuery

In this article we are able to see how to move cursor in to textbox on button click.
We are having a textbox with title “Name” for that textbox and a button with value “Chose Name”
We are having so many fields in the New Form and Edit Form, we placed a button to move the cursor to particular column while clicking on the button.

<html>
<input  type='button' onclick='selectperson()'  value='Choose Name />
</html>

<script>
function selectperson ()
{
$('input[title^="Name"]').focus();
}
</script>

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

Generate unique id in SharePoint using jQuery/JavaScript

In this article we are able to see how to generate unique id for each item, while creating an item, we are showing the Id in the NewForm.aspx
We are having text box with id “textbox1”, in the GenerateUniqueID method we are getting the Unique GUID as per our requirement we are adding the Prefix SP with six unique value with text and characters.

<html>
Unique ID:<input type="text" id="textbox1"/>
</html>

function GenerateUniqueID() {
uid = 'SP-' +'xxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random() * 16 | 0,
v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16).toUpperCase();
});
}
<script>
GenerateUniqueID;
$('#textbox1').val(uid);

</script>

Output:



SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

How to populate today’s date using JQuery in SharePoint

How to populate today’s date using JQuery in SharePoint
In this article we are able to see how to get the todays date based on condition from another column when we click on save button using JQuery

We are having a requirement with Stats Column with drop down  option, if the status column is in Completed then when we click on the save button it will display the todays date on Date column filed.

function PreSaveAction()
{
if ($("select[Title='Status'] option:Selected").val() == 'Completed') {
var date = new Date();
var datinformat = date.getMonth()+1 + "/" + date.getDate() + "/" + date.getFullYear();
$("input[title = 'DateField']").val(datinformat);
}
else
{
$("input[title = 'DateField']").val("");

}

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

How to populate value from one field to another field in SharePoint Using JQuery

How to populate value from one field to another field in SharePoint Using JQuery
In this article we are able to show how to populate from one filed to another field based using JQuery in SharePoint.

We are having two filed one is Dropdown filed and another one is Singlelinetextfield , whenever the user select the value in the dropdown we have to populate the same vale in to the single line if text.
Below is the code snippet

<script type="text/javascript" src="http://dotnetsharepoint.com/sites/SP/SiteAssets/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="http://dotnetsharepoint.com/sites/SP/SiteAssets/jquery.SPServices-2014.01.min.js"></script>
<script language="javascript" type="text/javascript">

$(document).ready(function()
{

$("select[title^='Dropdownfiled']").change(function() {
folderName=$("select[title^='Dropdownfiled'] option:selected").text();

$("input[title='singlelinetextfield']").val(folderName);
               
});

});


</script>
SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

how to change value in drop down based on button click using JQuery in SharePoint

how to change value in drop down based on button click using JQuery in SharePoint
In this article we can able to show how to change value in drop down based on button click
In the SharePoint List Edit page having button and column with name “Status” by default it was showing Status as Open, when we click on the button it will change the value to completed.


<script>
function ChangeStatus(){
$('Select[title=Status]').val('Completed');
}
</script>
<table>
<tr>
<td ><input type="button" id="btn" value="Change the Status" onclick="ChangeStatus();"/></td>
</tr>

</table>

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

How to get the date in textbox using JQuery

In this article we can able to see how to get the date with hours and minutes using JQuery.
We have to display the date, hours and minutes without any special characters.
Refer the JS file and use the below script.
Example:DDMMYYHHMM
  
<script>
var sp=new Date();
var day=sp.getDate();
var month=sp.getMonth()+1;
var year=sp.getFullYear();
var hour=sp.getHours();
var minute=sp.getMinutes();
var ddmmyy=day+""+month+""+year+""+hour+""+minute;
$("input[title^='DateField']").val(ddmmyy);
});
</script>

OutPut:




SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

SharePoint Kanban Board as a smart solution for SharePoint task management

Today I will take a look at very useful multi functional SharePoint component: a Kanban Board. This tool can be used as a project planning solution or even as a personal task board in SharePoint. This component is available as web part, as well as app for SharePoint Online.

The Kanban system is based upon cards placed on a board with columns. Each card splits work into tasks and each column represent steps in a workflow. Every process supports with horizontal lines (swimlanes), which can visually distinguish priority of sub-processes.
 With SharePoint Kanban, less time is spent for organization and task management. You can sort tasks between columns and swimlanes of a project with drag and drop feature, add customized markers, assign responsible users to the task and filter data by many custom fields.
  
  •  Use color-coded task cards with special markers. For example, red marker informs the task is overdue.
  •   Drag and drop task within customized columns and swimlanes.
  •   Create and apply condition filters such as priority, status, user assignment, project, etc.
  •   Aggregate data for columns with Total function (sum/average values) and measure time required for task closing.
  •   Set the permission list and control who can view, edit or manage tasks in SharePoint Kanban.
You can learn more about Kanban and download free trial on VirtoSoftware website:

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

how to populate current login user in to people picker using JQuery

In this article we can able to see how to populate current login user in to people picker using JQuery.
we are having  a requirement, when  we are trying to create a new item, there is a column with people picker field in that
Open list items in New Window SharePoint
Concatenate two fields and update the value into another field in SharePoint using PowerShell 
Get current login user in SharePoint using JQuery

we have to auto populate the user using the below code.

<script type="text/javascript" src="/sites/DotnetSharepoint/SiteAssets/jquery.SPServices-0.7.2.min.js"></script>
<script type="text/javascript" src="/sites/DotnetSharepoint/SiteAssets/jquery.SPServices-2014.01.min.js"></script>

<script language="javascript" type="text/javascript">

$(document).ready(function()
{
ExecuteOrDelayUntilScriptLoaded(loadConstants, "sp.js");
});

function loadConstants() {
var userName = $().SPServices.SPGetCurrentUser({
fieldName: "UserName",
debug: false
});
$('h3:contains("HereFieldDislplayNameinNewForm")').closest('tr').find('div[title="People Picker"]').html(userName);
$('img[title="Check Names"]').trigger('click');


}
</script>

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

Open list items in New Window SharePoint

Open list items in New Window SharePoint
In this article we are able to see how to open list items in to a new window in SharePoint.
We are having requirement, when user clicks on any list item it should have to open in new window, we can achieve this using JQuery.

Step: 1
Native to the particular list than you want to implement this functionality.

Step: 2
Edit the page, add script editor place the code as shown below.

<script>
$(document).ready(function(){
$('a[onclick*="EditLink2"]').removeAttr("onclick").attr("target","_blank") 
});
</script>

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

The Server Could Not Complete Your Request

We got an issue while we trying to open the site in SharePoint Designer we got an error “The Server Could Not Complete Your Request” as shown below.

We clicked ok and try to close, but it was repeatedly showing we open the Task Manger and in Application Tab we ended the Designer Session.

Resolution:
Open the IIS
Enable Anonymous Authentication for Your SharePoint Web Application
Select the Web application and Click on Authentication

Enable Anonymous Authentication as shown below.
For more information about this issue we also check this article 

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

Concatenate two fields and update the value into another field in SharePoint using PowerShell

In this article we can able to see , how to concatenate two fields and update the value in to another field in SharePoint using PowerShell.
How to update items in SharePoint using client object model
Get current login user in SharePoint using JQuery
We are have a site and list, inside the list we are having three columns we have to concatenate the  two field values and update the combined fields values to another field using PowerShell for existing items.

 Add-PSSnapin Microsoft.Sharepoint.Powershell
    $web =  Get-SPWeb -Identity "http://dotnetsharepoint.com/sites/sharepoint"
    $list =$web.Lists["ListName"]
    $items = $list.items
    foreach ($item in $items) 
    {
    $sourcevalue1 = $item["FieldName1"]
    $sourcevalue2=  $item["FieldName2"]
    $item["FieldName3"] = $sourcevalue1 +" - "+ $sourcevalue2
    $modifiedBy = $item["Editor"] 
    $modifieddate = $item["Modified"]
    $item["Editor"] = $modifiedBy
    $item["Modified"] = $modifieddate
    $item.Update()
    $list.Update()
    $web.Dispose()
}

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

SharePoint 2016 Document Library

 Simple controls for document library
  The new version of SharePoint 2016 has unique features in “Document Library”. The additional options available are Upload, Sync, Edit, Manage, and Share. These features enable more advanced options.
Now let us look at what each of these features do.

                                                         Fig 1: Document Library 

Upload
You can upload any document into the document library by clicking the “Upload” button. By click of this button the below screen is popped-up.
 

Browse and choose a file you need to upload and comments, then click ok.
Uploading documents can be done even by clicking new button or dragging a file you want to upload onto the screen.
Keyboard Shortcut: Alt + U = Upload
 
Sync
You can now sync this current library to your device. Now we can easily access your library from your device. When you try to sync , a pop-up will ask if you need to allow to open web content. Enable it by clicking allow.

Keyboard Shortcut: Alt  + Y = Synchronization

 Share 
If you want to share a particular document you uploaded in this library , then click on share option. On click, you get a pop-up where you can list the users you want to share you document and also grant the permission level to those users.

Keyboard Shortcut: Alt  + S = Share

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

How to update items in SharePoint using client object model

How to update items in SharePoint using client object model
In this article we are able to see how to update list items in SharePoint using client object model, without changing the modified user name and time in this sample example.

using Microsoft.SharePoint.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;

namespace updatefieldvalues
{
    class Program
    {
        static void Main(string[] args)
        {
            ClientContext context = new ClientContext("SiteName");

            context.Credentials = new NetworkCredential("UserName", "Password", "DomainName");

            context.Load(context.Web);

            List list = context.Web.Lists.GetByTitle("ListName");
            context.Load(list);
            string oldvalue = "OldValue";
            string newvalue = "NewValue"
            CamlQuery cQuery = new CamlQuery();
            cQuery.ViewXml = "<View><Query><Where><Eq><FieldRef Name='OldFieldName'/><Value Type='Text'>" + oldvalue + 

"</Value></Eq></Where></Query></View>";
           
            ListItemCollection ListItemCollection = list.GetItems(cQuery);
            context.Load(ListItemCollection);
            context.ExecuteQuery();
            foreach (var item in ListItemCollection)
            {
               item["NewFieldName"] =  newvalue;
                item["Editor"] = item["Editor"];
                item["Modified"] = item["Modified"];
                item.Update(); 
            }
            context.ExecuteQuery(); 
        }
    }
}

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

Get current login user in SharePoint using JQuery

Get current login user in SharePoint using JQuery
In this article we can able to know, how to populate current login user in SharePoint and we can able to populate in to people picker using JQuery.
First upload the JQuery in to the Site Assets library.

Navigate to particular list that you want to populate the current login user ,In the NewForm.aspx edit the page add the current editor edit it  and refer the JQuery file.

<script type="text/javascript" src="/sites/dotnetsharepoint/SiteAssets/jquery.SPServices-0.7.2.min.js"></script>
<script type="text/javascript" src="/sites/dotnetsharepoint/SiteAssets/jquery.SPServices-2014.02.min.js"></script>

<script language="javascript" type="text/javascript">
$(document).ready(function()
{
ExecuteOrDelayUntilScriptLoaded(populateCurrentUser, "sp.js");
});

function populateCurrentUser() {
var currentuserName = $().SPServices.SPGetCurrentUser({
fieldName: "UserName",
debug: false
});

var controlName = "Author"; // fieldname in the list
var peoplepickerDiv = $("[id$='ClientPeoplePicker'][title='" + controlName + "']");
var peoplepickerEditor = peoplepickerDiv.find("[title='" + controlName + "']");
var sppeoplepicker = SPClientPeoplePicker.SPClientPeoplePickerDict[peoplepickerDiv[0].id];
peoplepickerEditor.val(currentuserName);
sppeoplepicker.AddUnresolvedUserFromEditor(true);
}
</script>


SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

A great toolkit for SharePoint multiple files operations

This article describes how you can easy solve any SharePoint bulk files issue, using Virto SharePoint Bulk Operations Toolkit.

SharePoint Alerts and Reminders
SharePoint Gantt Chart Web Part

This tool consists of eight Virto components intended to quick working with SharePoint bulk files. You can copy, upload/download, delete, unzip, check in and edit multiple files, using this ready-to-use web parts for SharePoint bulk operations.

SharePoint Bulk File Upload allows you to upload multiple files into the document library with drag & drop and helps you get the job done! You can monitor the file uploading process and overwrite existing files if it is required.


You can also try a Html5-based SharePoint File Upload Web Part for SharePoint 2013. Using this web part, you can easily drag and drop SharePoint bulk files without adding files one by one.

SharePoint Bulk File Download Web Part allows you to download multiple files from SharePoint 2013, 2010 or 2007 libraries into single .zip archive. Just choose multiple files for downloading with checkboxes and store it at your local disk.


SharePoint Bulk File Unzip web part allows you to easily unpack bulk archives and save extracted files to the document library, keeping structure of original zipped folder. Existing files overwriting option is also supported. 

Also, you can quickly delete multiple files with SharePoint Bulk File Delete web part. Save your time by deleting SharePoint files in large, instead of deleting them individually.


SharePoint Bulk Data Edit web part allows you to edit multiple data all at once, just open a SharePoint list or Document Library and choose fields for editing. You can configure Bulk Edit web part for any SharePoint list or site scopes. With SharePoint Bilk Data Edit, you can save enormous amount of time without manually editing each document individually.


With SharePoint Bulk Check In and Approve web part, you can quickly check in and approve a large group of previously uploaded and currently checked-out documents. You can decide whether the files are checked in as published or draft versions. 


Using SharePoint Bulk File Copy and Move web part you can copy and move multiple files from SharePoint Library to a certain place. You can display all files of the chosen Document Library as a tree and choose files for moving. 


You can try every single web part or all this components combined in a single bundle. Enjoy all eight components of SharePoint bulk operations toolkit at a very attractive price. Learn more about this special offer and save over 40%!

Exclude search results for a specific site

Exclude search results for a specific site
In this article we can learn how to exclude search results for a specific site collection/site while creating a new result source in SharePoint 2013.


We are having a web application's URL’s and site collection URL that you want to exclude.

http://includeresults.com/ -------- we can search
http://SearchResults.com/  ------  we can search
http://SearchResults.com/sites/exclude  - we want to exclude this site from search   
          
Now we want to exclude this site collection/Site from the (http://SearchResults.com/sites/exclude) search results. Same way we can exclude the sites/sub sites also.


We are excluding the site using the property filter “not contains”, Please check the below screen shot.

Once everything is done, click on OK and finally save the Result Source.

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

How to send email using nintex workflow

 In this article we are showing a basic example how to send email using nintex workflow.

Here we are having a list with name “Basic Nintex Work Flow” with columns Title and Send mail columns as shown below.



In the top ribbon click on Workflow Settings to Create a Nintex Workflow

Select the Temple, we are selecting the Blank Template.
Click on Create


Drag and Drop the Send Notification as per the below screen shot


Click on drop down and click on configure.
Click on Addressbook
Click on Lookup in item properties select the field that you want to add on To address click ok.

Enter the Subject and adding test content inside the Body for Mail.


Click on Save.
In top ribbon workflow setting, we can trigger the workflow based on our requirement, in our case we are triggering the work flow once item is added or modified in the list.

Finally save and publish the workflow

Again go the list, enter the item with Title name and Send mail column with valid user.

Conclusion:
Now everyone know how to create a basic work flow in Nintex.
Please let me know having any doubts on this article.

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

SharePoint Interview Questions

SharePoint Interview Questions
In this Post we can able to see the SharePoint Interview Questions on Master Page.
These question will be same for SharePoint 2010 and 2013.

1) What is the difference between SharePoint 2010 and 2013?
2) What is master page in SharePoint?
3) How many ways we can customize master page?
4) What is Feature Stapling?
5) What is Layout Page?
6) What are different type of master pages in SharePoint 2010 and 2013?
7) How to maintain custom master page for a particular site?
8) How to hide search box in a master page?
9) How to hide the Site Contents in a master page?
10) How to add user control in master page?

11) How to inherit the master page from site collection level to sites and its sub sites?

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

How to Schedule PowerShell Script

In this article we are able to show how to Schedule PowerShell script using task scheduler.
Scheduling the PowerShell script is very easy, once we schedule the task it will start automatically without our interaction.

Start Programs -> Enter Task Scheduler.
 PowerShell
Right Click on Task Scheduler and click on Create Task as shown below.
In General Tab
Enter the Name and Change the options as per the Screen Shot
 PowerShell
In Triggers Tab, Click on New schedule the task as per your requirement.
In Actions Tab
Program/Script option browse the PowerShell.exe location
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Add Arguments (optional):- Add the PowerShell that you want to schedule.
Click on Ok.
In the Task Scheduler library we can able to see the Scheduled Jobs.
It will run automatically as per your scheduled time.
Please let me know having any doubts on this article.

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

How to debug PowerShell

Here we are able to learn how to debug PowerShell script, without an error we cannot complete the script in a single shot, we have to debug the code have to identify the issue need to fix it.
In PowerShell for debugger we can use windows PowerShell ISE
In Start enter the name PowerShell
Open the Windows PowerShell ISE


If you want to debug the code
Place the cursor and Press F9 or in the top menu place the cursor click on the Toggle Break Point where ever in the code you want o debug.


F10 is used to debug line by line in the current function or method.
F11 is used to debug line by line and also to debug inside the Methods or Functions.


SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

How to upload zip files in blogger

We want to upload zip files in to our blogger to download the source code for readers, but we did not find any option in the blog settings to add ZIP or RAR files.
Using the Google sites we can able to add the ZIP files in to our blog.
Login with your Gmail account credentials.

Click on CREATE.
As per the screen shot below
Select the Template that you want to create
Enter the Name of your site
Site location
At last check the Check box “I’m not a robot
Click on to Create page
Enter the Page Name
In the Template to use select “File Cabinet
Click on Add file, Select the file that you want to upload.
In the browser we can able to see the URL, Give the URL link  in the Blog Post, so that everyone can able to download  the ZIP or RAR Files easily.

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

Read xml using PowerShell in SharePoint

In this article we are showing how to read XML file using PowerShell, this is a sample example based on this we can develop the PowerShell scripts with config XML file, without touching the code modify the XML config file and send the mail based on the config file requirement, maintain the XML file will be very good and easy.



Here is the sample XML file to read the PowerShell for sending mail with to and from address with Subject and SMTP server information.

 Read xml in PowerShell
Here is the PowerShell code reading the XML file and sending Mail.

Add-PSSnapin Microsoft.SharePoint.Powershell

[xml]$xmlfile = Get-Content D:\Reading.xml

 $EmailFrom = $xmlfile.mail.mailFrom
  $EmailTo = $xmlfile.mail.mailTo
 $EmailSubject = $xmlfile.mail.mailSubject
 $SMTPServer = $xmlfile.mail.SMTPRelay

$mailmessage = New-Object system.net.mail.mailmessage

$mailmessage.from = ($EmailFrom)

$mailmessage.To.add($EmailTo)

$mailmessage.Subject = $EmailSubject

$mailmessage.IsBodyHTML = $true

$SMTPClient = New-Object  Net.Mail.SmtpClient($SMTPServer) 


$SMTPClient.Send($mailmessage)

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM