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

learn more… | top users | synonyms

1
vote
2answers
114 views

How to check whether item is being added or updated in PreSaveAction

I am using the PreSaveAction JavaScript function to handle list item add and edit operations. But depending upon whether the item is being added ( newform.aspx ) or being updated ( editform.aspx ) I ...
0
votes
1answer
89 views

WorkManagement API TypeError: this.get_context is not a function

I have one requirement to show the aggregated task list as a webpart in any page of SP 2013 on premise, where user will see the assigned task list directly without going onto my site. After some ...
0
votes
1answer
152 views

Update multiple User Profiles and their properties using CSOM

Is it possible to update multiple user profiles and their properties using CSOM. I have checked the code for SetSingleValueproperty() method, but can't use it for updating multiple properties for ...
1
vote
0answers
48 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
0answers
121 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
1answer
141 views

CSOM Iterate all SiteCollection in an SPO Tenant

I am trying to iterate over all site collections in a SharePoint Online Tenant. I found this code on the web and adapted it to my needs: context = ...
0
votes
1answer
79 views

Reset sharepoint lookup with None option using jquery

How to reset the lookup value to None in Editform.aspx page using Jquery. I want to empty the lookup dropdown if text box does not have any value . Here is the code which i have tried.I was able to ...
2
votes
0answers
100 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
votes
1answer
103 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
1answer
44 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
124 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 = ...
1
vote
0answers
68 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
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
26 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: ...
1
vote
2answers
54 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
0answers
37 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 ...
0
votes
1answer
46 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
243 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
61 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 ...
0
votes
2answers
104 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 ...
0
votes
0answers
84 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
141 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. ...
0
votes
0answers
30 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
36 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' ...
5
votes
2answers
344 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 ...
1
vote
2answers
82 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
40 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 ...
1
vote
1answer
252 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
102 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 ...
1
vote
2answers
528 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 ...
0
votes
1answer
36 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
2answers
67 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?
3
votes
0answers
267 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, ...
1
vote
0answers
191 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
111 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 ...
2
votes
2answers
185 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
1answer
57 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
262 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 ...
2
votes
1answer
800 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
148 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, ...
1
vote
0answers
55 views

How to provision External content Type using CSOM

Is it possible to provision External Content type and list using CSOM? Thanks in advance.
0
votes
2answers
102 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?
0
votes
0answers
39 views

An unhandled exception when connecting to sharepoint 365 via CSOM

Here is my Code: using System; using System.Security; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.SharePoint.Client; ...
0
votes
0answers
23 views

Csom Script insertion

I'm using SharePoint Designer workflow, I can,t use Visual Studio because of errors always popping when I deploy. I'm new to using SharePoint client objects, I use Jsom and include Js files in the ...
0
votes
1answer
41 views

Creating List based on List template with content

Now I could successfult create list based on list template but when i saved my list template i could say "Include Content" but when the list created by this code it was empty with no content any ...
0
votes
1answer
126 views

In SharePoint JSOM, how to get a column in the list by name?

The following code will get the list of all the fields in the SharePoint List, however what I m interest in is if a particular field exists or not. function ...
0
votes
1answer
34 views

Permission problem to get sub site info

i use this code to retrieve all sub sites under one sub site function GroupMenu(url,elem){ var sites = []; var clientContext =new SP.ClientContext(url); var webs = ...
0
votes
0answers
191 views

Webpart page content not being overwritten CSOM SharePoint 2013

I am using the code below to create a WebPart page. The content is an exported WebPart page that does not have any content (ie webparts) added to the page. This creates the page fine the first time ...
0
votes
3answers
303 views

Get all sharepoint sites in a site collection to which user has access using Javascript client object model

I want to display all sites in a site collection using JSOM to which user has access to. In other words I only need to find collection of sites to which user has access in a site collection. I am able ...
0
votes
1answer
38 views

Error on ClientContext

When I try to get sub sites of specific sub site var clientContext = SP.ClientContext('/groupcompanies'); var webs = clientContext.get_web().get_webs(); I get this error: undefined is not a ...