
This week, Vesa and Waldek are joined by Fabian Williams – Microsoft MVP – Visual Studios Development Technologies and Director for the Intelligent Process automation (IPA) practice at Withum located in Washington D.C.
In addition to Microsoft and Community activities and articles, the group focused on this question: Why should a Teams or SharePoint developer care about Azure Functions?
This episode was recorded on Tuesday, March 9, 2020
Got feedback, ideas, other input – please do let us know!
This post is a contribution from Jing Wang, an engineer with the SharePoint Developer Support team.
There are multiple ways to access SharePoint data with custom code, for example, CSOM, JSOM, SharePoint Rest API and Sharepoint Web Service call.
Troubleshooting problems with these accesses likely need correlation IDs of the failed requests. With the correlation IDs we can locate relevant errors in SharePoint ULS logs efficiently.
However, not all failed requests expose the correlation ID to UI, code or through network traces. In those scenarios, being able to set distinctive correlation IDs when send the requests to SharePoint become very useful.
- For CSOM (client object model code), it is straight forward to set it:
ClientContext context = new ClientContext(“https://{site_url}”);
Web web = context.Web;
context.TraceCorrelationId = “88888888111111112222222233333333”;
context.Load(web);
context.ExecuteQuery();
- For JSOM (JavaScript library code):
<script type=”text/javascript”>
var clientContext;
var website;
SP.SOD.registerSod(‘sp.js’, ‘/_layouts/16/sp.js’);
SP.SOD.executeFunc(‘sp.js’, ‘SP.ClientContext’, sharePointReady);
function sharePointReady() {
clientContext = SP.ClientContext.get_current();
website = clientContext.get_web();
clientContext.set_traceCorrelationId(88888888111111112222222233333333′);
clientContext.load(website);
clientContext.executeQueryAsync(onRequestSucceeded, onRequestFailed);
}
function onRequestSucceeded() {alert(website.get_url()); }
function onRequestFailed(sender, args){alert(‘Error: ‘ + args.get_message());}
</script>
- For SharePoint Rest API call:
<input id=”Button” type=”button” value=”Empty Site Recycle Bin” onclick=”runCode()” />
<script type=”text/javascript”>
function runCode(){
SP.SOD.registerSod(‘sp.js’, ‘/_layouts/16/sp.js’);
SP.SOD.executeFunc(‘sp.js’, ‘SP.ClientContext’, emptySiteRecycleBin);
function emptySiteRecycleBin(){
var restUrl = _spPageContextInfo.webAbsoluteUrl+”/_api/site/RecycleBin/deleteAll()”;
$.ajax({
url: restUrl,
type: “POST”,
//withCredentials: true,
headers: {
“X-RequestDigest”: $(“#__REQUESTDIGEST”).val(),
‘SPResponseGuid’: ‘88888888111111112222222233333333‘
},
success: function(response) {alert(“Emptied Site RecycleBin!”);},
error: function(response){ alert(“Error empting RecycleBin…” );}
});
}
}
</script>
Fiddler Trace shows the correlation ID was set successfully:

- For the calls to SharePoint Web Services, for example, listdata.svc or lists.asmx, we can hardcode the correlation IDs as well.
To make a web service call from C# code, you need to create web service reference to the service .svc file first, Visual Studio will generate the reference class for the web service automatically, for example, reference.cs:
The below is the code change needed to add into that class file:
namespace callwebservice.sp2016ws {
using System;
using System.Web.Services;
using System.Diagnostics;
using System.Web.Services.Protocols;
using System.Xml.Serialization;
using System.ComponentModel;
[System.CodeDom.Compiler.GeneratedCodeAttribute(“System.Web.Services”, “4.7.2053.0”)]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute(“code”)]
[System.Web.Services.WebServiceBindingAttribute(Name=”ListsSoap”, Namespace=”http://schemas.microsoft.com/sharepoint/soap/“)]
public partial class Lists : System.Web.Services.Protocols.SoapHttpClientProtocol {
private System.Threading.SendOrPostCallback GetListOperationCompleted;
…
protected override System.Net.WebRequest GetWebRequest(Uri uri)
{
var request = base.GetWebRequest(uri);
request.Headers.Add(“SPResponseGuid”,”88888888111111112222222233333333“);
return request;
}

In this episode, Vesa and Waldek are joined by Franck Cornu – Office 365 developer, architect and owner of aequos out of Montreal, Canada. Franck’s strength is bringing and bridging 3 perspectives – Developer, Architect and Functional Consultant, in every customer conversation. His collaborative approach is – define the backlog together, translate to functional requirements, consider functionality available from community and then define requirements for code, test and final delivery. Lately, Franck has been very actively contributing to the PnP Modern SharePoint Search solution web part.
This episode was recorded on Tuesday, March 3, 2020
Got feedback, ideas, other input – please do let us know!

In this episode, Vesa and Waldek are joined by Karoliina Kettukari – MVP and Microsoft Teams and Office 365 user adoption and change management consultant with Sulava in Helsinki, Finland. Their conversation focuses on the human side of technology deployments, not addressed by the mere roll-out/announcement of a new technology. It is clear, change is constant and change impacts people throughout the entire organization – directly and more often indirectly.
This episode was recorded on Monday, February 24, 2020