Tag Info

Hot answers tagged

4

You are missing a couple of rows in a working script. First, after setting the oList variable you need to load it: clientContext.load(oList); Then you need to fetch the value by calling: clientContext.executeQueryAsync( Function.createDelegate(this, onQuerySucceeded), Function.createDelegate(this, onQueryFailed) ); Now, you need to create the ...


2

Evidently this error occurs in case if file has been modified while updating the file: listItem.Update(); ctx.ExecuteQuery(); How about this approach? public static File UploadFile(ClientContext ctx, string sourceFilePath, string targetUrl,IDictionary<string,string> fileProperties) { var targetFileUrl = String.Format("{0}/{1}", targetUrl, ...


2

If you want to send an email using CSOM (js) you can use this: function sendEmail(from, to, body, subject) { var siteurl = _spPageContextInfo.webServerRelativeUrl; var urlTemplate = siteurl + "/_api/SP.Utilities.Utility.SendEmail"; $.ajax({ contentType: 'application/json', url: urlTemplate, type: "POST", data: ...


1

If your ultimate goal is to get SharePoint list items using JavaScript, then you can refer below set of functions. Also you can refer this useful msdn blog. function getListItems () { try { var clientContext = new SP.ClientContext('http://www.vignesh.cloudappsportal.com'); var oList = ...


1

Create a new RoleDefinitionBinding, object set the type of permissions to it and add it as parameter to RoleAssignments of list item: using System; using Microsoft.SharePoint.Client; using SP = Microsoft.SharePoint.Client; namespace Microsoft.SDK.SharePointServices.Samples { class BreakSecurityInheritanceAddUser { ...


1

AFAIK File class does not expose LinkingUrl property in SharePoint 2013 CSOM API (version 15.0.4420.1017) including the latest version April 2015 CU (15.0.4711.1000) Since File.LinkingUrl property returns an absolute file url, you could consider the following approach in SharePoint 2013 CSOM API: using (var ctx = ClientContext(webUri)) { var file = ...


1

Try this var context = new SP.ClientContext.get_current(); var web = context.get_web(); var list = web.get_lists().getByTitle("DocLibrary"); var query = new SP.CamlQuery(); var caml = "<View><Query><OrderBy><FieldRef Name='Modified' Ascending='FALSE' /></OrderBy></Query></View>"; ...


1

You can use success handler for reading file content function readFileSuccess(data) { alert(data); } Update var executor = new SP.RequestExecutor(weburl); var info = { url: fileContentUrl, method: "GET", binaryStringResponseBody: true, success: function (data) { //binary data available in data.body var result = ...


1

It is very possible look at the code provided by the office pnp team here: https://github.com/OfficeDev/PnP/blob/master/OfficeDevPnP.Core/OfficeDevPnP.Core/AppModelExtensions/TenantExtensions.cs#L414 public static void SetSiteProperties(this Tenant tenant, string siteFullUrl, string title = null, bool? allowSelfServiceUpgrade = null, ...



Only top voted, non community-wiki answers of a minimum length are eligible