API for interacting with SharePoint from .NET, Silverlight, and JavaScript.

learn more… | top users | synonyms

5
votes
4answers
3k views

Set DateTime (utc) to listitem (CSOM, SP2013)

How to set UTC timezone to a listitem's DateTime field without executing query each time? This would be slow for many datetime fields and items: var utc = DateTime.UtcNow; var localTime = ...
0
votes
1answer
628 views

502 DNS lookup failed error when using SharePoint 2013 CSOM

I am facing an issue while using CSOM in SharePoint 2013. I have configured an alternate access mapping for our site to run on http://mycustomdoamin.net/ The site is running fine and I am able to see ...
0
votes
1answer
902 views

Cannot invoke HTTP DAV request. There is a pending query during OpenBinaryDirect

I've to move some items from one document library to an other one in a different site. I use object client model to do this My issue is having an exception while i'm trying to open the file and here ...
1
vote
1answer
23 views

How to create a list template by using CSOM?

For creating a list template programmatically by using server object, I'm using the SaveAsTemplate() function. SPSecurity.RunWithElevatedPrivileges(delegate { using (SPSite oSPsite = new ...
1
vote
1answer
28 views

Can we distribute SharePoint DLLs with our application

Is my understanding of following page correct that we can distribute Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll with our application? Like we reference these DLLs in ...
1
vote
1answer
543 views

How to get server datetime without postback using JSOM or services

My application page may be long time without reloading, and user changed system date and time. And I need to know datetime from server, not from client.
0
votes
1answer
14 views

Unable to return Microsoft.Sharepoint.Client.File object Names filtered by extension

I'm attempting to retrieve a set of File objects filtered by extension. The following code works correctly (without the filter). FolderCollection productModelFolders = ...
0
votes
1answer
20 views

Getting error from display multiple selected external list item javascript

So here's the javascript I use to display item name of selected item from an external list: <script type="text/javascript"> var targetListItem; function ShowSelectedItems() { ...
1
vote
2answers
601 views

how to update properties of item in doc set with client object model

I've been able to create doc sets and upload files to it with the client object model. I am having difficulty updating the properties of the files in the doc sets. Here is what I've tried: public ...
1
vote
2answers
784 views

Exception calling “ExecuteQuery” with “0” argument(s): "The remote server returned an error: (400) Bad Request. CSOM SP13

I'm trying to add a page to my search centre in sharepoint 2013. Trying out cSOM too. Here is my code, I am getting a bug Exception calling "ExecuteQuery" with "0" argument(s): "The remote server ...
0
votes
4answers
1k views

SP2013 online : set_formDigestHandlingEnabled Error

I get the error : Object doesn't support property or method 'set_formDigestHandlingEnabled' when I try to get the current SPContext object from javascript code in an Office 365 site. I am ...
0
votes
1answer
1k views

Get a Content Type by Name (Title) using CSOM

I am applying a temporary fix to some CSOM code whilst a more permanent fix is given to me hence I want to create the equivalent of ctx.Web.Lists.GetByTitle("Contoso ...
0
votes
2answers
3k views

how to get list items fields using CSOM

I have to get other column value of list item whose "Title" matches with entered string in text box from the page. I am using CAML query to match "Title". But in Success function, how to get that ...
0
votes
1answer
25 views

Copy SharePoint file from Http to Ftp

Is there a direct way to copy a file from a SharePoint library to an Ftp location? Currently, I'm able to download the document to a local directory using the OpenBinaryDirect method, however this ...
0
votes
1answer
51 views

Can you display all fields from a SharePoint list without writing them specifically?

Is it possible to retrieve every field value of a SharePoint List Item and display them on a web page without specifically calling them individually? I know it is possible to retrieve all the items ...
2
votes
1answer
710 views

Extract text from document in a SharePoint 2013 library

I would like to extract the text from documents stored in a SharePoint 2013 online document library. I have the document loaded using: ClientResult<Stream> data = file.OpenBinaryStream(); ...
2
votes
1answer
1k views

How to open file in adobe reader using command line without checkout from Javascript?

I am working on print functionality. I am printing the PDF files (uploaded in SharePoint Library) using Adobe Reader command line from javascript. I am using ActiveX object to call the cmd. refer ...
1
vote
1answer
658 views

Retrieve Multi-line Text Field with Append Changes in CSOM (Javascript)

I have been looking for an answer to this question all morning and i cannot find anything to point me in the right direction. We have several customizations to a SharePoint page which displays list ...
0
votes
1answer
32 views

Retrieve file version metadata with CSOM

My organization is requiring that we rewrite all of our sandbox solutions as we shift to SP 2013 as provider-hosted apps using CSOM. One of the event receivers I wrote would previously use the ...
4
votes
1answer
1k views

How to get a client context for App in provider-hosted Apps?

I use a provider hosted Apps, so need to work with an App Web and Lists. Could anybody provide a code snippet to get ClientContext() of the App? Can I do something like this? Uri appWeb = new ...
0
votes
1answer
521 views

SharePoint 2013 External Content type. Populate secondary fields

I am trying to migrate data to a document library that contains a external content type using the SharePoint 2013 client object model. The external content type is pulling from a sql server 2012 ...
2
votes
3answers
6k views

REST Adding New List Item

I am currently using office 365 and lots of REST queries to display data. However I am now creating my own forms using bootstrap and JQuery. However, how do I use REST to add the data to the list. ...
0
votes
2answers
747 views

Get project custom fields (Project Server)

I am trying to access, in a project detail page, the project context via Javascript to retrieve the data of the custom fields. But my problem is that, when I try to access all the data it only shows ...
0
votes
0answers
32 views

Check if user has access on site using client object model

Need to check if any user (provided user name) has access to site using c# client object model. It is sharepoint online site. Any suggestions/help is greatly appreciated.
0
votes
2answers
2k views

How to Get User Active Directory Groups in Sharepoint Online

I can't find any documentation or a way to find if a user belongs to an AD group with Javascript neither with the REST API or with the client model JSOM. I have a page in a Sharepoint site and I want ...
4
votes
2answers
2k views

How to get caml query to return list items created by the current user?

I want a caml query that only retrieves items created by the user currently logged in. I tried this specifier = "<Eq><FieldRef Name='AssignedTo'/><Value ...
0
votes
1answer
19 views

Sharepoint App: Create a list using javascript on the host web, list does not appear on site content

So here I am creating a list on a sharepoint app, the app has full control over the host web. I run the code and it does not trigger any exception, but If I check the host site contents, the list does ...
2
votes
1answer
635 views

Copy files/folders between site collection and retaining metadata

I'm using SharePoint 2013 I need to copy files/folders/sub folders from one site collection to different site collection(basically archiving them). I need to do this remotely by using CSOM/JSOM. ...
0
votes
1answer
69 views

How to get all checked out files in SharePoint client object model c#?

I need to get all checked out files from a document library. I am trying by following query. CamlQuery camlQuery = new CamlQuery(); camlQuery.ViewXml = @ "<View> <Query> ...
50
votes
10answers
23k views

How do I know if the page is in Edit Mode from JavaScript?

Is there a way to find out if a page is in Edit Mode from JavaScript? I know in on the server-side can be found using SPContext.Current.FormContext.FormMode but I can't find any means of doing it ...
1
vote
1answer
547 views

Dynamically create metadata and associate it with File using Client Object Model

Is there any way to dynamically add metadata in the upload file. I am using the following code in this regard. File uploadFile = context.Web.GetFileByServerRelativeUrl(location); //check out to make ...
1
vote
2answers
642 views

Sharepoint 2013 publishing page creation using Client Object Model

I am using SharePoint 2013. Is there any way I can programmatically create a page using ONLY th Client Object Model? Also notice that the page should be editable for further use.
2
votes
3answers
8k views

SharePoint COM - SP.ClientContext(siteUrl) - Object doesn't support this action

Using the SharePoint COM to update a list item, but my function is failing. function updateProjectEC(projID, totalEC) { if(totalEC !== 0) { console.log("projID: " + projID); ...
2
votes
1answer
4k views

How to use CSOM/Powershell to update list item(s) in O365 from CSV

Not a programmer, but need to get a job done. Using Powershell and CSOM I've found examples and been able to import CSV into a list as new items. That is working. Here is a code snippet I'm using ...
1
vote
0answers
16 views

Copy all folders in a library to another library [duplicate]

I have a Sharepoint library which is having 10 folders, i want to move those folders(along with files inside those folders) from one library to another library with in same site using CSOM**(C#)**. ...
1
vote
2answers
2k views

Attach file in CustomList Item using Sharepoint.Client object

Hi is there a way to attach file in specific Custom list item? Currently i tried to add files on the root folder using below code: using (ClientContext context = new ...
0
votes
0answers
19 views

SharePoint online : Add a property in property bag of host web using JSOM

I am working on a simple SharePoint hosted app which has two text boxes to take input KEY and VALUE and add this to the property bag of the HOST WEB. I am able to read the existing properties from the ...
0
votes
1answer
23 views

Dynamic fields in SharePoint 2013 forms

I have a custom SharePoint list form where I would like to have country names(from another list) in one row with a check box in front of each row. On checking of any check box in front of country ...
2
votes
1answer
1k views

How to change 'Modified By' column value when a new file is uploaded in SharePoint 2013 using Client Object Model?

I want to change 'Modified By' column value of a file that is being uploaded using Client Object Model in SharePoint 2013. The problem is that the version of the file is changing. Kindly help me. The ...
2
votes
1answer
516 views

Sharepoint 2010 CSOM Get user and his groups by login name

I want to get a user and all his groups by a login name. Easy to do in Sharepoint 2013. clientContext.Load(site, l => l.RootWeb.SiteUsers, l => l.RootWeb.Id, l => l.Id); ...
0
votes
0answers
20 views

SPService object is not loaded!

I am working on a script to fetch the user profile services and get the current logged in user. This was initially working on IE8 and not working in IE11. Now its not working in any browser, any ...
1
vote
2answers
34 views

How to use Microsoft.SharePoint.Client.File.SaveBinary method?

I want to save a file from document library to local drive. I am using the Client Object model approach model in development. The following is the code that I use: ...
4
votes
2answers
736 views

SharePoint 2013: Using JSOM, get a list of all sites user has access too

I was looking at the JSOM documentation, but couldn't find a nice way to spin through all site collection and sites to show a user what they have read access to. Is this possible using JSOM and a ...
0
votes
0answers
20 views

update list items from one site to another site using client side object model in SharePoint

We migrated a site from lotus notes o SharePoint to different SharePoint server which is not in our control,in SharePoint site created by and modified by values are coming as current system login ...
3
votes
0answers
321 views

SharePoint Online CSOM create managed properties

I'm trying to find a way to deploy search managed properties via script to my Office 365 SharePoint tenant. Previously, for on-prem SharePoint I've achieved this using PowerShell - fairly straight ...
0
votes
1answer
43 views

List web part with option button in place of checkbox

I want to allow on a list web part a mutually exclusive selection for the items, so that I can force the user to select a single item and retrieve the item id using the SP.js JSOM. There is a problem ...
1
vote
2answers
579 views

How to create sub site context in sharepoint online using app model

I am trying to create a sub-site and some predefined lists in the existed site collection. I am successfully created the sub site in the site. But Now i want to create lists in that newly created ...
0
votes
1answer
2k views

SPServices - GetRolesAndPermissionsForCurrentUser

I have a list where one group of users is not allowed to delete items but they have view and edit permissions. All items in the list contain an attachment. However, users are not allowed to delete the ...
3
votes
2answers
1k views

Set request access email address through CSOM

In the server side object model it's possible to set the request access email address through the property SPWeb.RequestAccessEmail (MSDN). Since we are moving our SharePoint tenant to Office365 I'm ...
7
votes
1answer
221 views

How to access a custom field of a list using REST

I'm trying to get information from a list in a custom SPField called "My Field" with the internal name "MyField" using this JavaScript code: $.ajax({ url: ...