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

learn more… | top users | synonyms (3)

1
vote
0answers
37 views

Creating/Updating Folder failing for asynchronous client calls on Update

I am using CSOM to create folders and upload files on a Sharepoint 2013 document Library. I am creating folders and subfolders inside them by calling the code below in a loop and trying to set their ...
0
votes
1answer
31 views

Javascript to display defaulteditform in modal dialogue used by sharepoint

Does anyone have the javascript required to display the defaulteditform in the modal dialogue that SharePoint (v2010) displays an edit form in ? I'd like to add this to my html ?
0
votes
1answer
43 views

Paging in CSOM with sharePoint results

how do we implement paging for results after we get results in onSuccess function, I have like this: for(var i = 0; i <results.length; i++){ } But ...
0
votes
0answers
78 views

Office365 REST API bad request while saving data to List

In a SharePoint hosted App am trying to save data to my list in Office 365 using REST API below is the code. The problem with this code is it works fine for less values passed (eg: my in my item I ...
0
votes
0answers
36 views

Distinguishing between SharePoint Instances

I need to distinguish between unique SharePoint Instances in my provider-hosted App. I used to determine them on the Host-Url like that: initializeSharePoint(Request["SPHostUrl"]); // Interactions ...
2
votes
0answers
39 views

Try - Catch CSOM

I am trying to implement try - catch in CSOM - JavaScript, I have the following code: var ctx = new SP.ClientContext.get_current(); var exScope= new SP.ExceptionHandlingScope(ctx); ...
1
vote
2answers
611 views
1
vote
1answer
264 views

consuming external web services(https) in share point hosted apps resulting cross-domain issue

We are not able to consume external web services deployed in a separate domain from sharepoint hosted apps,using jquery ajax.
2
votes
1answer
104 views

Error while closing Modal Dialog (JavaScript)

So I create a Modal Dialog with this code: function openModalDialog(title, url, callback) { var options = { title: title, url: url, dialogReturnValueCallback: callback ...
1
vote
3answers
369 views

Get List by “InternalName”

I'm trying to use the SharePoint 2013 JavaScript Object Model to retrieve a List via an internal name equivalent. SPList doesn't have a Name or Internal Name property. It is referred to by the ...
0
votes
1answer
34 views

JSOM request limitations

I'm building a custom navigation for SP2013 that uses termstore to manage the menu items reasonably. This technet article covers basic termstore limitations, but it doesn't touch on the following ...
3
votes
1answer
82 views

Retrieve subsites from site collection sort last modified date using CSOM

I want to retrieve subsites from current site collection. And it should be order by last item modified date. I am able to retrieve subsites by following code : channel_context = ...
2
votes
1answer
480 views

Hiding the toolbar of a Listview webpart through CSOM

I recently successfully added a web-part to the frontpage using the method from Add Document Library XsltListViewWebPart using CSOM or web services However, it seems impossible to disable the toolbar ...
3
votes
2answers
538 views

Publish contenttype after activating feature (Office 365)

I've created a Contenttype and some fields in a visual studio project. They are deployed when activating the "Content types"-feature. But here's the problem: I want them to be deployed to the Content ...
1
vote
0answers
39 views

Call Javascript Function After Saving Calendar Item

I am having a script as below:- function getColorValue(aId,atitle) { try{ var clientContext = new SP.ClientContext(); var oWebsite = clientContext.get_web(); var oList = ...
0
votes
1answer
63 views

Cross-Domain Calls in SharePoint - Comparism

Basic Example mysite.mysharepoint.com has clientside code that wants to access a list on mysharepoint.com due to whatever reason. the Same-origin policy forbids this Possible Workarounds SSOM ...
0
votes
0answers
16 views

Exception while retrieving all available Site-Columns Sharepoint Client Model [duplicate]

I'm trying to retrieve all available site-columns from my sharepoint site. This is what I do: ClientContext clientContext = new ClientContext(siteURL); clientContext.Credentials = ...
0
votes
0answers
14 views

Changing DocumentSet Name in RemoteEventReceiver ChangedItemProperties Collection

I have a RemoteEventReceiver listening on ItemUpdating (synchronous event). The EventReceiver is registered to a Document Set Library. Now I want to change some Properties during the event: ...
0
votes
2answers
55 views

SP.UI.ModalDialog Namespace or Reference

Is there any server side reference for SP.UI.ModalDialog? What is the reference for SP.UI.ModalDialog for client side? How i reference this in webpart?
5
votes
2answers
169 views

Reliably get attachments for list item

I'm working with SP2010's SP.js and I need to get all the attachments of a list item. As it's SP2010, I don't have access to SP.ListItem's attachmentFiles property. :( The following code works for ...
8
votes
5answers
23k views

Get Site Collection full URL using javascript

I want to get the URL for my site collection. One way I thought I could do it was using the window.location in javascript and getting it that way. I know that you can use ECMA script and the client ...
1
vote
2answers
43 views

How can I see the fields available for retrieval via get_item()?

I'm using Javascript CSOM to try and integrate a Discussion list into a site I'm working on. However, I can't figure out what Discussion item fields are available for me to access via get_item(). I ...
0
votes
1answer
37 views

JSOM function not getting called

I have two functions in my js file. Each function is used to fetch data from list. The first function is called as: jQuery(document).ready(function () { SP.SOD.executeFunc('sp.js', ...
0
votes
3answers
59 views

JSOM: Why web.lists.GetByTitle('myList') does not throw exception while web.Title throw exception

In JSOM, we can not access a property of an object before load and excecute. But I don't understand why code 1 works and code 2 doesn't: Code 1: Here I am accessing the List property of web var ...
1
vote
0answers
33 views

How to execute a SQL Agent Job on a button click in a Web Part page of a SharePoint 2013 site?

I have a SharePoint 2013 on-premises site. The requirement is to add a button to one of the Webpart pages and on click of that button, a sequence of 3 consecutive SQL Server Agent jobs will be ...
3
votes
3answers
423 views

List version limits client-side

Versioning can be defined the same way in UI in SP2013 and O365: How can we programmatically set these limits in SP2013 without server-side code? Server-side we would have SPList.MajorVersionLimit ...
0
votes
2answers
58 views

Forms Authentication in Sharepoint 2013, _vti_bin/authentication.asmx error

I'm getting this error when using CSOM in a FBA web application that is configured agains't a custom FBA provider. I'm getting this error when site is configured for Forms, if a disable forms with ...
2
votes
0answers
71 views

Get object of ribbon button in JavaScript

I am trying to access the ribbon button via JavaScript. Below is my code: // Get the page manager var ribbonPageMgr = SP.Ribbon.PageManager.get_instance(); // Get the ribbon var ribbon = ...
0
votes
0answers
55 views

Requested value 'CheckBoxes' was not found

There's a weird thing happening with my Windows application. I have created a Sharepoint utility to automate the creation of content-types and site-columns. At a point where I try to get my available ...
1
vote
2answers
75 views

Create a site-column of type user, multichoice and multiuser using Sharepoint Client Object Model

I'm trying to create site-columns with following types: Text, Note, Number, Choice, User, MultiUser, MultiChoice I've implemented it for all the types except for User, MultiChoice and MultiUser. ...
2
votes
2answers
102 views

JSOM Anonymously CAML query list items

I am attempting to query a list using CAML via JSOM and am getting the error message The method "GetItems" of the type "List" with id "{GUID}" is blocked by the administrator on the server. I have set ...
0
votes
0answers
22 views

Validate unique value for the list item via JavaScript Object Model

Could you please help me with implementing following logic: I need to check new uploading document name with existing documents. If dublicate or simular document exists, it shoud show existing names ...
0
votes
0answers
26 views

How to specify InternalName for a list field in Sharepoint Client Object model

I'm trying to add a field to my current list. This is what I've achieved so far: Field description = list.Fields.AddFieldAsXml( @"<Field Type='Note' Name='DataType' ...
1
vote
2answers
62 views

Add a lookup field for a list in Sharepoint Client Model

This is what I've achieved do far: var listCreationInfo = new ListCreationInformation(); listCreationInfo.Title = "New List"; listCreationInfo.TemplateType = (int)ListTemplateType.CustomGrid; List ...
0
votes
0answers
18 views

Prevent NewItem / Edititem dialog from closing on save OR redirect **dialog** on Save

Before reading further, I am specifically referring to an NewItem.aspx or EditItem.aspx opening up in a SharePoint 2013 dialog box. At the moment I am opening a "New Item" and/or "Edit Item" list ...
0
votes
1answer
358 views

Taxonomy control in SharePoint hosted app

I am creating an SharePoint hosted app. In that I have to use Managed MataData from my list. In this I am getting the Metadata from my list column to my Taxonomy control. I have find some post but I ...
1
vote
1answer
125 views

Too many automatic redirections were attempted

I am having some trouble when trying to us the SharePoint Client Object Model against a SharePoint 2013 installation. I am attempting to write some code which will allow both the upload and download ...
0
votes
1answer
60 views

Create docx file in document library using JSOM

I have written a script which creates a new txt file into the document library using Javascript. When I change the file extension to docx, it still creates but I'm unable to view the file.. It gives ...
0
votes
2answers
37 views

How to handle list item events from client side using JSOM?

My requirement is like - When an item is added to a list, a log should be added to another list? And this needs be done using JSOM. is there a way to achieve this using JSOM?
1
vote
2answers
77 views

How to get web part id

This is a follow up question to the one i asked earlier : Reading web part properties using javascript object model In my earlier question I had been able to access the properties using jsom but i am ...
10
votes
8answers
11k views

How do I determine a user's SharePoint group membership using the client object model?

I want to redirect users from a landing page to another page in SharePoint 2010, based on their group membership. I need to do this using JavaScript (ECMAScript) and not server side code.
4
votes
2answers
2k views

Is it possible to create site collection using CSOM?

I have been trying out to create site collection using CSOM but unable to fins and class which creates site collection. I have read in MSDN that CSOM runs as site collection scope hence creating site ...
2
votes
0answers
130 views

Use CSOM with ADFS credentials from Single Sign-On enabled ASP.NET MVC app

I have the following setup: ADFS 3.0, SharePoint 2013 and the custom ASP.NET MVC app. Both SharePoint and MVC app are configured to use Single Sign-On from ADFS, so once user is logged in via ADFS, he ...
1
vote
0answers
88 views

Update ID field with client object model

I'm trying to create items in a list and set the ID field programmatically (for use in a lookupfield in another list). This works serverside by setting the property ReadOnlyField of the field ID to ...
1
vote
1answer
61 views

JavaScript: get webpart context by DOM ID

I have an already loaded page with webparts. I want to get the webpart context object by using IDs which I can get from the DOM, e.g. webpartid="bf385785-6507-4af1-b419-b8bf30dc5103" Basically the ...
0
votes
4answers
79 views

Retrieve data from taxonomyfield using jsom gives error

I have a managed metadata type column in my document library. I need to get the data from this column by using jsom. But whenever I try to get the values it gives me error. The code and error are ...
8
votes
3answers
7k views

Check if user is in a specified group

I would like to check with JavaScript if the current logged user is in a specified and specific group (for example called "Admins Group"). How can I do? Thanks
0
votes
1answer
32 views

Adding group to as Site Administrator using CSOM

Is it possible to a add an existing group as SharePoint site collection administrator using CSOM(Client Side Object Model)? Please share the code for doing the same.
2
votes
1answer
192 views

Reading web part properties using JavaScript Object Model in SharePoint 2013

I am using the below code to read the properties of a web-part using JSOM. While i can read the properties of the web-parts that are there on the current web part page, I would like to know of a way ...
0
votes
3answers
70 views

SP.ClientContext does't exist

I have SharePoint site, wherever I open developer tools and type: SP. I don't get the ClientContext as a suggestion, it's not loaded at all in SharePoint. I tried that on SharePoint application pages, ...