Sharepoint Pundit
Vinay Chavadi's Blog on Application Development in SharePoint 2010/2013/2016 & SharePoint Online
Monday, September 21, 2020
Friday, July 14, 2017
Programatically accessing SharePoint List using REST API in CSOM
using Newtonsoft.Json.Linq; //JSON.Net
static void Main(string[] args)
{
var webUri = new Uri("https://Your SharePoint Server/sites/IA/");
const string userName = "username";
const string password = "password";
var securePassword = new SecureString();
foreach (var c in password)
{
securePassword.AppendChar(c);
}
var credentials = new SharePointOnlineCredentials(userName, securePassword);
var list = GetList( credentials);
//print List title
Console.WriteLine(list["Title"]);
}
public static JToken GetList(ICredentials credentials)
{
using (var client = new WebClient())
{
client.Headers.Add("X-FORMS_BASED_AUTH_ACCEPTED", "f");
client.Credentials = credentials;
client.Headers.Add(HttpRequestHeader.ContentType, "application/json;odata=verbose");
client.Headers.Add(HttpRequestHeader.Accept, "application/json;odata=verbose");
var result = client.DownloadString("https://Your Server name/sites/IA/_api/web/lists/getbytitle('Listname')");
var t = JToken.Parse(result);
return t["d"];
}
}
static void Main(string[] args)
{
var webUri = new Uri("https://Your SharePoint Server/sites/IA/");
const string userName = "username";
const string password = "password";
var securePassword = new SecureString();
foreach (var c in password)
{
securePassword.AppendChar(c);
}
var credentials = new SharePointOnlineCredentials(userName, securePassword);
var list = GetList( credentials);
//print List title
Console.WriteLine(list["Title"]);
}
public static JToken GetList(ICredentials credentials)
{
using (var client = new WebClient())
{
client.Headers.Add("X-FORMS_BASED_AUTH_ACCEPTED", "f");
client.Credentials = credentials;
client.Headers.Add(HttpRequestHeader.ContentType, "application/json;odata=verbose");
client.Headers.Add(HttpRequestHeader.Accept, "application/json;odata=verbose");
var result = client.DownloadString("https://Your Server name/sites/IA/_api/web/lists/getbytitle('Listname')");
var t = JToken.Parse(result);
return t["d"];
}
}
Sunday, November 6, 2016
New Features of SharePoint 2016
New Features of SharePoint 2016:
1) Emphasis on Hybrid possibilities with On-Prem SP 2016 & O365
One Drive Re-Direction: You can redirect your My Sites to your Office 365 subscription’s OneDrive for Business host Sites you follow in one place – On-Prem + O365 – Sown under Sites in App Launcher.
Hybrid Cloud Search – Unified Search Experience- the Office 365 Search will take your On-Premises SharePoint Search Index so that it can give you results from both for the same query.
** Delve helps you discover the information that's likely to be most interesting to you right now - across Office 365
2) App Launcher & UI Changes
SharePoint 2016 introduces the App Launcher, as well as changes to the UI, to help it match the Office 365 experience.
3) Server Roles (Min Role) - You can now install just the role that you want on particular SharePoint 2016 servers. WFE/ App/ Distributed cache/Search/ Custom
4) Zero Downtime Patching - They’ve also removed the downtime previously required to update SharePoint servers.
5) Removed 5,000 View Threshold – sort of: Instead of removing this unpopular threshold, they automated the creation of Indexed Columns.
6) Increased File Size for uploads – 2 GB to 10 GB
7) Fast Site Creation - Site Collections in 1 second from 40 seconds previously
8) New Compliance Center in SharePoint 2016 - In-Place Policy Hold Center and the Compliance Center – Help you to define your own compliance polices
9) New Collaboration Experience – Touch friendly interface
10) Link Durability: Links that are shared to documents on SharePoint 2016 can still work even if the filename is changed or if it moves to a different site collection.
1) Emphasis on Hybrid possibilities with On-Prem SP 2016 & O365
One Drive Re-Direction: You can redirect your My Sites to your Office 365 subscription’s OneDrive for Business host Sites you follow in one place – On-Prem + O365 – Sown under Sites in App Launcher.
Hybrid Cloud Search – Unified Search Experience- the Office 365 Search will take your On-Premises SharePoint Search Index so that it can give you results from both for the same query.
** Delve helps you discover the information that's likely to be most interesting to you right now - across Office 365
2) App Launcher & UI Changes
SharePoint 2016 introduces the App Launcher, as well as changes to the UI, to help it match the Office 365 experience.
3) Server Roles (Min Role) - You can now install just the role that you want on particular SharePoint 2016 servers. WFE/ App/ Distributed cache/Search/ Custom
4) Zero Downtime Patching - They’ve also removed the downtime previously required to update SharePoint servers.
5) Removed 5,000 View Threshold – sort of: Instead of removing this unpopular threshold, they automated the creation of Indexed Columns.
6) Increased File Size for uploads – 2 GB to 10 GB
7) Fast Site Creation - Site Collections in 1 second from 40 seconds previously
8) New Compliance Center in SharePoint 2016 - In-Place Policy Hold Center and the Compliance Center – Help you to define your own compliance polices
9) New Collaboration Experience – Touch friendly interface
10) Link Durability: Links that are shared to documents on SharePoint 2016 can still work even if the filename is changed or if it moves to a different site collection.
Office 365 Video Feature
Videos is new feature in Office 365 offering which has state of the art video streaming capabilities and in this feature videos are stored in Azure Media services which will give better end user experience for people who are viewing the videos.
Office 365 Planner - Microsoft's Answer to Kanban Cards
Planner , recently introduced in Office 365, is useful tool for simple task management.This tool is great for managing internal projects that have a team working on them. You can assign tasks, add due dates and have comments on the tasks to allow easy communication and collaboration within the team.
Solved Remote Event Receiver on updated will be firing multiple times in SharePoint 2013/16
Most of you who are working on Remote Event Receivers must have encountered this issue of "Updated event getting fired multiple times". The following code should fix the issue:
Use the adding or updating events. And then update the title within the "ProcessEvent" as follows:
public SPRemoteEventResult ProcessEvent(SPRemoteEventProperties properties)
{
SPRemoteEventResult result = new SPRemoteEventResult();
result.ChangedItemProperties.Add("Title", "NEW Title");
result.Status = SPRemoteEventServiceStatus.Continue;
return result;
}
public SPRemoteEventResult ProcessEvent(SPRemoteEventProperties properties)
{
SPRemoteEventResult result = new SPRemoteEventResult();
if (properties.EventType == SPRemoteEventType.ItemAdding ||
properties.EventType == SPRemoteEventType.ItemUpdating)
{
// Generate Image Search for Flower
result.ChangedItemProperties.Add("Title",
"My New Title");
result.Status = SPRemoteEventServiceStatus.Continue;
}
return result;
}
Reference:
http://code.msdn.microsoft.com/office/SharePoint-2013-Add-list-2c6e71e0
Use the adding or updating events. And then update the title within the "ProcessEvent" as follows:
public SPRemoteEventResult ProcessEvent(SPRemoteEventProperties properties)
{
SPRemoteEventResult result = new SPRemoteEventResult();
result.ChangedItemProperties.Add("Title", "NEW Title");
result.Status = SPRemoteEventServiceStatus.Continue;
return result;
}
or
public SPRemoteEventResult ProcessEvent(SPRemoteEventProperties properties)
{
SPRemoteEventResult result = new SPRemoteEventResult();
if (properties.EventType == SPRemoteEventType.ItemAdding ||
properties.EventType == SPRemoteEventType.ItemUpdating)
{
// Generate Image Search for Flower
result.ChangedItemProperties.Add("Title",
"My New Title");
result.Status = SPRemoteEventServiceStatus.Continue;
}
return result;
}
Reference:
http://code.msdn.microsoft.com/office/SharePoint-2013-Add-list-2c6e71e0
Thursday, October 27, 2016
SharePoint 2013 Search References
God References for SharePoint Search:
https://sharepoint.rackspace.com/search-tutorial
http://social.technet.microsoft.com/wiki/contents/articles/25783.sharepoint-2013-working-with-result-sources-to-limit-search-results.aspx
https://blogs.technet.microsoft.com/sharepoint_made_easy/2013/03/19/step-by-step-configuration-to-add-custom-refiners-in-the-refinement-panel-of-search-results-page-for-sharepoint-online/
https://sharepoint.rackspace.com/search-tutorial
http://social.technet.microsoft.com/wiki/contents/articles/25783.sharepoint-2013-working-with-result-sources-to-limit-search-results.aspx
https://blogs.technet.microsoft.com/sharepoint_made_easy/2013/03/19/step-by-step-configuration-to-add-custom-refiners-in-the-refinement-panel-of-search-results-page-for-sharepoint-online/
Avoid default results in content search web part in SharePoint 2013
User \\{SearchBoxQuery?} in the Query text to avoid showing default results in the search result web part.
Reference:
https://prasadpathak.wordpress.com/2013/08/09/sharepoint2013-avoid-default-results-in-search-result-and-content-search-web-part-with-search-box/
Reference:
https://prasadpathak.wordpress.com/2013/08/09/sharepoint2013-avoid-default-results-in-search-result-and-content-search-web-part-with-search-box/
Wednesday, October 26, 2016
Infopath Alternative StratusForms Form Builder
StratusForms Form Builder is a free tool which will help you get started creating new StratusForms forms for SharePoint. It does not contain all the possible functionality for StratusForms.
http://www.stratusforms.com/formbuilder.html
For more information on StratusForms including information on creating PeoplePickers, Encrypted fields, and other functionality please visit http://www.stratusforms.com or join the discussion on our IT Unity channel at https://www.itunity.com/community/stratusforms.
http://www.stratusforms.com/formbuilder.html
For more information on StratusForms including information on creating PeoplePickers, Encrypted fields, and other functionality please visit http://www.stratusforms.com or join the discussion on our IT Unity channel at https://www.itunity.com/community/stratusforms.
Subscribe to:
Posts (Atom)
-
There are 3 SPJobLockType available: 1. SPJobLockType.None -- if you set it none, the instance will run in all the available s...
-
User \\{SearchBoxQuery?} in the Query text to avoid showing default results in the search result web part. Reference: https://prasadpatha...