Tag Info

New answers tagged

1

If the user who you are Sharing File is part of SharePoint then you can simply pass the URL to the user, who can access the file directly. For external users, you can get this link using ObjectSharingInformation class. This class has property AnonymousEditLink and AnonymousViewLink You can use below snippet for that var item = //code to get list item.. ...


0

So i resolved this issue. New folder of List must be added like new ListItem by List.AddItem(ListItemCreationInformation parameters) method. Just need to set ListItemCreationInformation.UnderlyingObjectType to FileSystemObjectType.Folder. Example: List listCopyTo = ClientContext.Web.Lists.GetByTitle("ListName"); ListItemCreationInformation newFolderInfo = ...


0

I cannot comment your post yet, so I take a shot at answering. Have you checked in your view parameters that you are allowing the folders to be displayed ? One other thing, in your List advanced settings, do allow folders to be created in your list ?


0

There is no specific class for storing choice field value like in case of, for example, user field value in CSOM API. Since multiple choice field value is stored in string array, the following example demonstrates how to retrieve it: var list = ctx.Web.Lists.GetByTitle(listTitle); var listItem = list.GetItemById(itemId); ctx.Load(listItem); ...


0

Had similar issue on SharePoint 2013. Please check the following when you want to specify custom schema XML: You have to specify correct list template TemplateType (like: 100, 101). Here is enumeration. IMPORTANT! You have to specify template feature ID property correctly. Check this link where are listed all template types and their feature id's.


0

I unfortunately couldn't get any of the above working, so I used an ugly hack: public static List GetListByUrl(ClientContext context, string listUrl) { List result = null; ListCollection lists = context.Web.Lists; context.Load(lists, all => all.Include(l => l.RootFolder)); ...


0

public void Main() { using (var clientContext = new ClientContext(@"https://microsoft.sharepoint.com/teams/PAF/")) { var passWord = new System.Security.SecureString(); foreach (char c in "NextGenReport@2014".ToCharArray()) passWord.AppendChar(c); clientContext.Credentials = new ...


0

to answer my own question SP2010 is by default windows authentication and SP2013 is claims based the below code worked for me ClientContext clientContext = new ClientContext("http://sp2013:27898"); clientContext.ExecutingWebRequest += clientContext_ExecutingWebRequest; Web web = clientContext.Web; GroupCollection groupColl = ...


0

You can do this by Passing NetworkCredentials as below ClientContext clientContext = new ClientContext("http://sp2013/"); clientContext.Credentials = new NetworkCredential("UserName", "Password","Domain");


0

Use PublishingWeb.AddPublishingPage method to create a new PublishingPage object in the PublishingWeb from Microsoft.SharePoint.Client.Publishing namespace in SharePoint 2013 CSOM. Example public static PublishingPage CreatePublishingPage(ClientContext ctx, string pageName, string pageLayoutName) { var pubWeb = PublishingWeb.GetPublishingWeb(ctx, ...


4

For those who are still looking for the answer. SharePoint 2013 (since SP1 at least see UPD below) contains special method Web.GetList. It accepts site-relative url for the list, i.e. site/dev/lists/mylist. Sample code for .NET object model: var ctx = new ClientContext("http://sp2013dev/sites/dev"); var list = ...


0

@eirikb: Unfortunately, there is a "minor" problem with this approach. Although it is not well documented, the property has (wisely) no global effect. It does not disable all of the event receivers in the farm, nor does does it disable triggering event receivers in the current list for activities occured on other threads. It has a scope local to the current ...


1

Try foreach (ListItem listitem in allitems) { DataRow row = table.NewRow(); //Multi Line Text if(listitem["Comments"] != null) row["Comments"] = listitem["Comments"].ToString(); //Number int tempId = 0; if(listitem["EmployeeID"] != null && int.TryParse(listitem["EmployeeID"].ToString(), out tempId)) ...


1

The parameter $ListInfo.TemplateType = "100" needs to be $ListInfo.TemplateType = "106" to create a calendar list. For all template types see the documentation here: https://msdn.microsoft.com/en-us/library/dd958106%28v=office.12%29.aspx


2

Map SharePoint library/site as a Network Drive. Now use Windows Explorer to browse file and open with your favourite editor. From my knowledge only SharePoint Designer Gives you a tree view navigation which we can use to browse the files and edit/save. Update You can use some registry tweak so that you can open files using your favourite editor from ...


1

It depends whether the specified list item belongs to List or Documents library: for Documents library: var absItemUrl = item.get_item('EncodedAbsUrl'); for List you could return url of display form page Example function getListItemUrl(listTitle,itemId,success,error) { var ctx = SP.ClientContext.get_current(); var web = ctx.get_web(); var ...


1

After upload you need to set it using clientContext.Load(file); ListItem item = file.ListItemAllFields; item["Title"] = "Title"; item.Update(); clientContext.ExecuteQuery();


0

Make sure Nedia you follow all the steps explained here: Link. Or you can refer this example here. I doubt that there might be some problem with the App permission you are assigning for the app. Using CSOM you can do your operation but for that first you need to assign the permission to your app to access those functionalities. Hope this helps!


0

JSLink is great but not the only solution. Your code can easily be put in a Calculated Column; if set to output as Number it will evaluate the HTML and display the IMG "<IMG src=""http://URL/sites/Main/Testing/Webparts/JSLink/Status-"&[Status]&".png"">" By the looks the only image name you have to rename is On-time


1

It seems your template is not applied since clienttemplates.js library is not yet loaded when SPClientTemplates.TemplateManager.RegisterTemplateOverrides function is invoked. Instead of (function () { var overrideContext = {}; overrideContext.Templates = {}; overrideContext.Templates.Fields = { 'Status': { 'View': overrideTemplate ...


1

The following example demonstrates how to reorder fields in content type using CSOM var ctId = "0x01020047F5B07616CECD46AADA9B5B65CAFB75"; //Event ct var listTitle = "Calendar"; using (var ctx = new ClientContext(webUri)) { var list = ctx.Web.Lists.GetByTitle(listTitle); var contentType = list.ContentTypes.GetById(ctId); //retrieve fields ...


0

It's still quite uncomfortable to upload documents by using the JSOM API. But it's possible. In your case your Word file must be not larger than 1.5 MB. Additionally the clients browser must support HTML5. Here is a code example (it references also the jQuery library): $(document).ready(function () { // Get the URI decoded host web URL // We will ...


1

The best way to open a modal dialog in SharePoint 2013 is to use the built-in JavaScript function called "OpenPopUpPage". This was introduced in SP2010 and is used widely throughout SP2013. To change the page being loaded within the modal dialog, you can then use a simple "window.location.href" function. EXAMPLES: Opening a Modal Dialog <a href="#" ...


0

Rather than write (and debug) your own query, I would recommend using the GetListItems function of the SPServices library. If you're using JavaScript, it's super easy to implement both jQuery and the SPServices library to get some awesome & much-needed functionality. Once you have the libraries loaded on your page (I usually put them in my master page), ...


2

After upload you can do it as clientContext.load(this.newFile, 'ListItemAllFields'); var item = this.newFile.get_listItemAllFields(); item.set_item('Username', value); item.Update(); clientContext.ExecuteQuery...


1

You don't need to load unless you want to read data. You can simply set_item then update. Then when you do executeQueryAsync the changes get committed in the back end. Here is updated code function createListItemProdus() { var clientContext = new SP.ClientContext.get_current(); var oList = ...


1

SharePoint 2013 provides a new client object model that enables you to create SharePoint solutions that run remotely from the SharePoint server farm. For example, the client object model enables you to consume and manipulate SharePoint data in Windows Forms applications, WPF application, console applications, Silverlight applications, and ASP.NET Web ...


2

After loading the items, the query needs to be executed and then the result should be parsed in the success handler. Example: function retrieveListItems(siteUrl) { var clientContext = new SP.ClientContext(siteUrl); var oList = clientContext.get_web().get_lists().getByTitle('Announcements'); var camlQuery = new SP.CamlQuery(); ...


0

I finally got around the issue. I fixed the response using FiddlerCore, replacing https xmls namespaces with http namespaces. I have this class that is acting as an http proxy and is responsible for fixing the respose: using Fiddler; using Org.BouncyCastle.Security.Certificates; using System; using System.Collections.Generic; using System.IO; using ...


1

You should pass a SPQuery object to the GetItems method. In the query attribute you have to put just the <Query> tag. Use: SPQUery query = new SPQuery(); query.Query = "" //your <Query>...</Query> tag //for all your view field query.ViewFields ="<FieldRef Name='ID'/>" To specify the row limit use: query.RowLimit = 100; To ...


0

Lists are a part of SPWeb not SPSite. Once you have the correct web, it's pretty easy to extract the list from the web. ClientContext context = new ClientContext(webUrl); context.Credentials = new NetworkCredential("user", "password", "domain"); targetWeb = context.Web; targetList = targetWeb.GetList("http://server/listUrl"); context.Load(targetList); ...


2

You need to return the promise in the itemIsDuplicate() function, not the success callback. Just move return deferred.promise(); to the end of the function. You'll might want to either add deferred.resolve() to the error callback, or a deferred.reject() if you need to execute something after an error occurs. Code should be as such: function ...



Top 50 recent answers are included