Tag Info

Hot answers tagged

3

As part of using AddFieldAsXml you need to provide the field's internal and staticname announcementy.Fields.AddFieldAsXml("<Field Type='User' DisplayName='Created By' StaticName='CreatedBy' Name='CreatedBy'/>", true, AddFieldOptions.AddToAllContentTypes); announcementy.Fields.AddFieldAsXml("<Field Type='DateTime' DisplayName='Date Created' ...


2

Return the results of your first call (which will be a jQuery Deferred object) then use that object with jQuery.when() in order to force all of the first calls to complete before the second one can begin: $('.littcls').each(function() { // *** use these variables to hold all of the promises you create in the loop var addTTItemPromises = [], ...


2

As a part of the new Minimal Download Strategy (MDS) the sp.js library is not loaded until explicitly called in SharePoint 2013. Solution Use SP.SOD.executeFunc function to ensure that sp.js library is loaded and then run the specified callback function: SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function(){ //Your code goes here, for example ...


2

You have to specify the URL to new SP.ClientContext(url) From MSDN: var url = 'replace with server-relative or absolute URL'; var clientContext; var website; // Make sure the SharePoint script file 'sp.js' is loaded before your // code runs. SP.SOD.executeFunc('sp.js', 'SP.ClientContext', sharePointReady); // Create an instance of the client context for ...


2

The syntax for loading Default View URL is below. context.load(lists,'Include(DefaultViewUrl)'); Default view is a valid list property and we need to explicitly load it.


1

Hi i already solve my problem below is my code: List docs = web.Lists.GetByTitle("CustomList"); ListItem item = docs.GetItemById(ID); var attInfo = new AttachmentCreationInformation(); attInfo.FileName = mFile.Name; ...


1

Since List.DefaultViewUrl property is not loaded by default you have to include it explicitly as demonstrated below: var context = SP.ClientContext.get_current(); var lists = context.get_web().get_lists(); context.load(lists,"Include(Title, DefaultViewUrl)"); context.executeQueryAsync( function () { var e = lists.getEnumerator(); while ...


1

It could be an issue with this, since it changes scope when you use it in the delegates, try using var items= list.getItems(camlQuery) as you do in your first snippet: function getItemsWithCaml(listTitle) { //use of $.Deferred in the executeQueryAsync delegate allows the consumer of this method to write 'syncronous like' code var deferred = ...


1

How to create Wiki page using SharePoint CSOM The example below demonstrates how to create wiki page via CSOM (VB.NET version): Sub CreateWikiPage(context As ClientContext, pageName As String, pageContent As String) Const templateRedirectionPageMarkup As String = "<%@ Page ...


1

There is no built-in method in SharePoint CSOM API for copying Folder with Files from one location into another. The following solution demonstrates how to copy files from source folder into destination folder: public static class FolderExtensions { /// <summary> /// Copy files /// </summary> /// <param ...


1

Since Folder resource does not expose Content Type property I would recommend you to create Folder using SharePoint 2010 REST endpoint, in that case Content Type could be specified as demonstrated below: function createFolder(webUrl,listName,folderUrl,folderContentTypeId, success, error) { var urlParts = folderUrl.split('/'); var folderPath = ...



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