JavaScript Object Model

learn more… | top users | synonyms

0
votes
2answers
24 views

How do I enable Intellisense sp.js in VS 2012. TILT

No matter what I try, I keep on getting the yellow triangles with the message "Intellisense was unable to colmplete an accurate...". For example when I type "SP." then among others ClientConetext does ...
0
votes
0answers
29 views

Sharepoint JSOM: set_item() without update()

I'm using SharePoint Javascript Object Model (JSOM). Can someone explain to me what set_item() does and what update() does? Below is some code to illustrate. Boilerplate code to get the list items: ...
0
votes
0answers
19 views

Set Managed Metadata Value on SP2010 Item using JSOM

Okay I am fairly sure that I've searched through everything, but I can't seem to figure out how to set a managed metadata value for an item using JSOM in 2010... Why can't we just upgrade to 2013... ...
1
vote
1answer
21 views

Get SharePoint group's MembershipGroupId in JSOM

I am trying to get MembershipId of SharePointGroup using GroupName. I can reach to the group using below but unable to get the member function or property which will give me Id for that group. ...
0
votes
1answer
7 views

REST addViewField “Cannot handle the data at position 0.”

I'm currently writing an initialisation script for a SharePoint-hosted application which checks if a list (used for launcher items) exists. If it doesn't, then it runs through a series of processes to ...
2
votes
1answer
31 views

Query Pages using REST

I've developed a newsfeed app part that currently gets its information from a list, however we're keen to have article pages that we can click through too. So far I've not found anything in the REST ...
2
votes
1answer
35 views

Create a document set with JSOM

I'm trying to generate document sets on the fly with the following code. It is using /_layouts/15/SP.DocumentManagement.js for the SP.DocumentSet.DocumentSet.create method which takes four parameters. ...
0
votes
1answer
13 views

Can I sort Rest by multple fields?

How can I get order Reset results with 2 colums? /_vti_bin/listdata.svc/News?$filter=Expires+ge+datetime'2012-11-23'&$orderby=Created also I want to order by the filed Topnews
0
votes
0answers
28 views

Configure Personal site through REST

I am having difficulty accessing the users personal site details through REST on O365. I would like to run the code from the intranet home page (companyname.sharepoint.com) and of course I cant use ...
0
votes
2answers
55 views

How do I move files from one document library to another using JSOM?

I have two document libraries on the same web, and am wanting to move the files from one to the other using JSOM/CSOM. Can anyone please shed some light on how to do this? Thanks
2
votes
0answers
19 views

SPListItem.BackwardLinks equivalent in CSOM, JSOM, or REST?

In the Server API for SPListItem there is a property called BackwardLinks that returns a collection of items that link to the item. I don't see the same property in CSOM, JSOM, or REST. Is there a ...
3
votes
1answer
91 views

How do you properly write to a managed metadata column from JSOM? (SharePoint 2013)

I am trying to write the value of a managed metadata column across several documents in a document library at once using JSOM, but for some reason the way I'm trying only writes the value to the first ...
1
vote
0answers
12 views

Remove App Part chrome from JSOM (SP2013)

I've built a sharepoint hosted app that contains a single App Part. This part can be inserted in any page by adding a new App Part through the ribbon. This all works fine. Now: The App part ...
1
vote
0answers
27 views

Invoke Asset Picker from JSOM

I have a custom page layout hosting Javascript. In it, I have a text field and a browse button that when clicked should open the SharePoint Asset Picker and subsequently populate the text field with ...
1
vote
2answers
54 views

How to fetch Newsfeed using JSOM

Is there a way to fetch Newsfeed with Link to Hashtag and all rich content using JSOM? We are able to fetch Newsfeed but all text is coming in plain text whithout any link to Hashtags. Is there a ...
3
votes
2answers
99 views

What are the advantages of using SP Services?

What advantages would I gain by using the SP Services library in SharePoint releases 2010 and later? The 2013 (and even the 2010) JavaScript Object Model and REST API seem to cover a significant ...
0
votes
1answer
31 views

Check In file with Javascript and REST

I am trying to check in a file from my sharepoint-hosted app with jsom and rest, but it wont work my code look like this: function checkInFile() { var hostUrl = ...
0
votes
0answers
81 views

Kick off Sharepoint 2013 workflow using JSOM in app

I'm trying to make a SharePoint 2013 app which kicks off a workflow. Already googled and tried samples, but keep getting this error : 0x800a139e - JavaScript runtime error: The property or field ...
0
votes
0answers
17 views

Stuck on designing library with folders for each User

I have a requirement to create an HR document management structure, but I'm a little stuck on how best to design it. Environment: SP2013 Standard... they don't want anything that would make an ...
0
votes
0answers
49 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
0answers
15 views

custom page allowing verification of existing item

The scenario is that I need a multi stage pages. Ideally I would like to do this on a single page but for simplicity 2 pages are fine. On the 1st page I need to verify if an item exists in the ...
0
votes
3answers
64 views

Enabling Content Types in Document Library using JSOM

I created some JavaScript Code whose purpose it is to create a Document Library, enable Content Types in it and add another content type. I added it to my SharePoint 2013 environment using the script ...
1
vote
1answer
84 views

How to create a Document Library with Metadata Column using JSOM

I am trying to automate the creation of a document library. Therefore I have a button which after clicking on it creates a new document library with at least one managed metadata column. I already ...
0
votes
1answer
59 views

Identify if a Library item is a folder or not in CSOM

I have Library on which I have created a ribbon button. On click of the button I am trying to identify if the selected item is a folder or a file. below if the code snippet that I am using: var ...
2
votes
2answers
115 views

How to retrieve all items from a list by javascript object model and store it to array

I'm new to JavaScript Object Model in SharePoint 2010 and want to get some idea of that. I wrote below code to get all list items of a SharePoint library. This works fine and return all items. But I ...
2
votes
1answer
326 views

Using JSOM or REST get list items stored in a different web application

In an on-premises SharePoint 2013 environment I need to read list items stored in a different web application using JavaScript based solution. This could either be JavaScript in Script Editor web part ...
0
votes
1answer
72 views

Error starting a workflow on host web from within a SharePoint-hosted app

I am trying to start a workflow on the host web from within a web part in an app. Here is my code: var clientContext = new SP.ClientContext.get_current(); var hostWebUrl = hostUrl; var ...
0
votes
1answer
99 views

ReferenceError: SPClientTemplates is not defined

I am trying to use the client-side People Picker and I can't get it to initialize the people picker due to SPClientTemplates not being defined. I am following MS documentation line by line but cannot ...
0
votes
1answer
53 views

What governs the decision to use server object model or client object model or javascript object model or REST?

What governs the decision to use (in SharePoint 2013)?: server object model (ssom) client object model (csom) JavaScript object model (jsom) REST
0
votes
0answers
10 views

Querying 'Append Changed to Existing Text' from client script?

Is there a way, preferably via REST but JSOM would work, to query a SharePoint 2010 field to get all entries when 'Append Changes to Existing Text' on a multiple lines of text field is enabled?
1
vote
1answer
142 views

Read DOCX files using javascript in sharepoint 2013

Can we fetch contents of DOCX files uploaded in a doc library from javascript code ? I could easily read a TXT file ref : http://msdn.microsoft.com/en-us/library/office/jj163201(v=office.15).aspx . ...
0
votes
2answers
156 views

Invoking SP.ModalDialog in Sharepoint 2013 Hosted Apps

I'm building a SharePoint 2013, SharePoint Hosted app project using the JSOM api. I have to make use of the SP.UI.ModalDialog to popup some content in the app. I have used the getScript method to ...
1
vote
3answers
233 views

SharePoint 2013 getting all webs in a given site collection including root web using JSOM

Using JSOM I am trying to get the collection of all the webs(sub-sites) including the root web of a given site collection and display there title. Below is the code snippet. But it throws error ...
0
votes
1answer
132 views

get properties from an List Item

I'm following a code sample from msdn to get properties of items from a list. My announcements list has 2 items. But for some reason I get an exception while getting the enumerator (TypeError: ...
2
votes
2answers
136 views

SharePoint 2013 reading data from multiple document libraries from multiple subsites in one site collection

I have multiple subsites in single site collection. All of these subsites have document library with same name. So is it possible using JSOM to read data from multiple document libraries with same ...
2
votes
2answers
181 views

Updating list items by JSOM

I am currently trying to migrate a list from one sharepoint to another. I did this a few months ago allready and there it worked not bad. But now I run into problems. The list is a discussion list. I ...
0
votes
2answers
81 views

SharePoint Hosted App Code behaves different

This code is working if i dont use it in a app. But in a app its not working. The app is sharepoint hosted, and the list is on the same domain as the app. context = new ...
0
votes
1answer
50 views

Using results of executeQueryAsync with JSGRID

I understand I can retrieve the list data using context.load(data) and later firing context.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, ...
0
votes
2answers
62 views

Insert record with Date into list via JSOM, problem with UK Format

I have found that when inserting a record which contains a Date using JSOM the update(); will not work if you specify the format of the date to be UK date (28/05/2014). The code does not error, it ...
1
vote
1answer
67 views

Upload file using JS and REST. Specify content type

I can upload file to SharePoint library using JS and REST. The content type of added file is as library default content type. How can i specify file content type when uploading file? Thanks!
0
votes
2answers
205 views

SharePoint hosted APP - Create subsite with JSOM under hostweb - Access is denied

I'm trying to create a SharePoint hosted app that creates a subsite under the hostweb with JSOM. The app has full control on the site collection. Why do i I getting this error message: My code: ...
0
votes
2answers
50 views

Get the ID of a new listItem and update same record

I'm trying to add a new record and get the new ID created then use the new ID to create a specific reference number using the following code. function saveDraftGHrecord() { ghList = ...
1
vote
2answers
513 views

Get/retreive managed metadata column value from Document Library using SharePoint 2013 JSOM

I am trying to retrieve managed metadata column (NewsCategory) value in SharePoint 2013 Document library using JSOM. I get "Object Object" rather than actual value. I tried:- var newsCat = ...
2
votes
2answers
344 views

Get list id from open view page via JavaScript

I have included some javascript in SharePoint master page, I need this javascript to have access to the opened list ID. For example when I load ...
0
votes
3answers
87 views

Check if the home page is checked out by the current user

Using JSOM, I would like to check if the home page is checked out, and if the current user is the one who checked-out the page. The test occurs from another page. Here is what I have now: var ...
0
votes
1answer
47 views

Csom code works if alert is implemented

This code works if i have a alert before , when i remove it, the isUserInList always shows false. Maybe i need to have a return value in CheckIfUserIsInList(); function ? var isUserInList = ...
1
vote
0answers
38 views

Access Items in DocumentSet using JSOM

I'm attempting to access items in a DocumentSet using SharePoint 13's JSOM. I am able to access the generic list properties but I do not see how to access ContentType specific properties on the client ...
1
vote
1answer
179 views

SharePoint Online, javascript get user properties

I'm trying to get some user properties and alert them (I'm going to put them i labels later but just for now I'm using alert). I'm using a content editor with this code: ...
1
vote
1answer
26 views

Get the SUM of Items from Media library in all site collections in SP2010 using JavaScript

How to get the SUM of Item Count from "Media" library in all site collections(more than 100) in SP2010 using JavaScript(or any other way). I've more than 100 site collections and each site collection ...
1
vote
1answer
166 views

SharePoint JavaScript Object Model Security and Permissions

I am writing an application whose logic executes in the browser using JSOM. The application might have permissions that exceed that of those who access the application. Let's say the application ...