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

learn more… | top users | synonyms

1
vote
2answers
111 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
27 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
31 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
254 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
71 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
32 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
217 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
90 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
324 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
34 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
57 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
227 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
160 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
96 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
156 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
47 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
205 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
556 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
118 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
46 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
87 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
33 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
21 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
30 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
89 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
25 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
167 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
255 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
35 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 ...
0
votes
1answer
36 views

Get Latest Created List Item

I got array of objects that is list items arr = [{id:"1",name:"item1",created:"Wed Feb 04 2015 03:36:42 GMT+0400"},{id:"2",name:"item2",created:"Sat Feb 04 2015 02:44:39 GMT+0400"}] i want to get ...
0
votes
0answers
44 views

Setting Url Variable for Sub site

I'm trying to create news list system. I wanted to set Url Variable via Javascript and get the item back by id to display details. Everything went good but when I try to href ...
0
votes
0answers
81 views

Get Item from content type using Microsoft.SharePoint.Client.Search.Query.KeywordQuery(context) and display data in app part

How can I get a list item using Microsoft.SharePoint.Client.Search.Query.KeywordQuery(context) instead of a list query. I want to use the content type and not depend on the list to get the items.
0
votes
4answers
128 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 ...
0
votes
1answer
141 views

SharePoint 2010 Javascript JSOM creating a List View Web Part using javascript

I was able to follow along and add a Content Editor web part to a page using javascript from MSDN here. I am now interested in trying to find a way to add a List View or Data View web part to a page ...
0
votes
1answer
50 views

JSOM code not executing correctly when run without debugging

I have a custom js that creates dynamic layout. There is a function which renders this layout consisting of multiple divs. When I debug the JS, the layout is rendered correctly but when I run it ...
1
vote
2answers
265 views

How to assign masterpage via CSOM?

I have the following code to assign masterpage via CSOM but its not working, after I go to the site, it says File not Found, I guess URL is wrongly constructed. Please note that I am not trying to ...
0
votes
1answer
40 views

External websites calling Sharepoint data

I'm trying to figure out if what I'm looking to do is possible. We have existing websites that are not Sharepoint based. Internally, we have an anonymous enabled Sharepoint site we'd like to publish ...
0
votes
2answers
99 views

Csom or rest to verify user

I am uploading a spreadsheet to a task list using visual studio - the sheet will usually have users that are misspelled or incomplete and SharePoint throws a not a user error. I have to go back fix ...
2
votes
1answer
111 views

PropertyOrFieldNotInitializedException even if the field is loaded

I am using the below part of code in provider hosted app: Microsoft.SharePoint.Client.File destinationFile = destinationFolder.Files.Add(fileCreationInfo); ListItem ...
0
votes
1answer
154 views

SharePoint 2013 CSOM Upload a document from asp.net website

I am trying to upload a document from an ASP.NEt website (not an App) to a SharePoint library and using CSOM. This is an on premise sharepoint 2013, not office 365. Below is the code to upload the ...
2
votes
0answers
92 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
2answers
388 views

How to create a search using sharepoint JSOM

I'm new to SharePoint and JSOM and i'm trying to build up a search using JSOM. and i tried below code snippets I FOLLOWED FOLLOWING BLOG ...
4
votes
1answer
344 views

Most efficient way to get all sub sites under a site collection/sub site using JSOM?

For the question lets assume the following site hierarchy Root Site Sub Site 01 Sub Site 0101 Sub Site 0102 Sub Site 010201 Sub Site 02 Sub Site 03 Sub Site 0301 Now if I want to get all ...
1
vote
1answer
21 views

How to create site custom field

How can i create custom fields for a site or sub site like Title and Description i've sub sites and every site has unique banner and some information i want the user will be able to add these ...
0
votes
1answer
97 views

How to get all lists and document libraries in subsite

What I want to achieve now is to retrieve all document libraries and lists in sub sites with links to those libraries via JavaScript. So I can add them to my Page Layout to be like Side Nav
0
votes
1answer
79 views

How to get parent site lists

I am using JavaScript on a subsite to retrieve items from a list which is on the parent site. When I use this code: var clientContext = SP.ClientContext.get_current(); var lists = ...
0
votes
1answer
30 views

Retrieve list items Links

When retrieving list items via Javascript, how to get the link or action to click and go to that item link?
1
vote
2answers
167 views

Create a Sharepoint wiki page using JSOM

I need to create a Sharepoint wiki page using JSOM, Can anyone guide me to create path? I'm very very new to Sharepoint and eager to learn. I found this but it uses Rest API and didn't find it very ...
-3
votes
3answers
79 views

Unable to get property 'get current' of undefined or null reference

function listAllCategories() { var ctx = new SP.ClientContext(appWebUrl); var appCtxSite = new SP.AppContextSite(ctx, hostWebUrl); var web = appCtxSite.get_web(); //Get the Web var list = ...
0
votes
2answers
33 views

Real Columns names

var clientContext = SP.ClientContext.get_current(); var lists = clientContext.get_web().get_lists(); var oList = clientContext.get_web().get_lists().getByTitle(listName); var collListItem; var ...