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

learn more… | top users | synonyms

1
vote
0answers
219 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
127 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
198 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
61 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
309 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
991 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
166 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
63 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
123 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
43 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
42 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
153 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
44 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
215 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
337 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
39 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
38 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
50 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
94 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
5answers
211 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
176 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
56 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
422 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
50 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
183 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
160 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
237 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
120 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
655 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
572 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
138 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
140 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
33 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
258 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
107 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
34 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 ...
0
votes
3answers
349 views

Java script how count users in group by javascript

How could I count how many users are in Group? How could I count by JavaScript.
2
votes
3answers
279 views

ExcuteQueryAsync functions inconvenient

Can any body explain this ? clientContext.executeQueryAsync( Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed)); it always output an Error in ...
0
votes
2answers
317 views

SharePoint Online Iterating through Document Libraries CSOM

I am trying to iterate though a document library and set each document/items within to inherit permissions (at the moment each doc/item is using uniquer permissions). I am able to get the specific ...
1
vote
1answer
87 views

RoleDefinitions.BreakInheritance 2013 CSOM API

I need to break permission level inheritance. The following works fine with the server API: SPWeb.RoleDefinitions.BreakInheritance(true, true) Now I need to do the same with Sharepoint 2013 CSOM ...
3
votes
3answers
258 views

Why does .get_title() called from an (SPOnline) App-Web return an incorrect Localized DisplayName?

!! this is NOT about localisation of the App Web Its about getting an incorrect response from the HostWeb when using get_title() !! Can someone please explain me where I go wrong with the testcode ...
0
votes
2answers
49 views

Retrieve all files from all folders

I've a picture Library which contains to folders i've retrieved them by this code getListItems('myList'); function getListItems(listName) { var clientContext = SP.ClientContext.get_current(); var ...
0
votes
0answers
29 views

How to select parent list whole data with child list data. CHild list containing parent lookup field

I am trying to get data from chlid list which contains parent lookup filed.Also to get parent list data with child data by using join but got nothing can anyone provide me way how to do this
1
vote
1answer
142 views

How to use result obtained from clientContext.executeQueryAsync

i have to use result obtained from clientContext.executeQueryAsync for condition in code.But, now i face problem that clientContext.executeQueryAsync result not obtained when needed.
0
votes
1answer
147 views

'u.Email' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException'

'u.Email' threw an exception of type 'Microsoft.SharePoint.Client.PropertyOrFieldNotInitializedException' When I try to get the email from a user in a list. Here is mycode: CamlQuery query = ...
2
votes
2answers
178 views

Sharepoint 2013 Development Boundaries

I need some understanding around SharePoint 2013 Development model. What are SharePoint 2013 Development Boundaries? What SharePoint developer can and cant do with each model?
0
votes
1answer
247 views

how to search document from sharepoint 2013 document library using c#

i need C# code for to search documents from SharePoint 2013 document library. i was uploaded documents in SharePoint document library now i want to search all uploaded documents by using c# coding . ...
0
votes
1answer
100 views

The remote server returned 403 forbidden when creating subsite using remote provisioning pattern

I have the following scenario on sharepoint online. One Site collection with: RootWeb List Clients List Projects Subsite called Clients for hosting each client subsite One RER to create a client ...