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