JavaScript Object Model

learn more… | top users | synonyms

0
votes
2answers
28 views

Get list default view url in SharePoint JSOM Client Object Model

I have simple JSOM script to get all the list and it's default view url but i am not getting default view url property var context; var lists; // This code runs when the DOM is ready and creates a ...
0
votes
2answers
19 views

How are Deferreds different from callbacks

I have following piece of SharePoint JavaScript client object code which works perfectly without throwing any error. $(document).ready(function () { //don't exectute any jsom until sp.js ...
0
votes
0answers
13 views

Using SP.UserProfiles.PersonalSiteInstantiationState

I am attempting to check a User's MySite status by utilizing sp.js to return the following enumerations. I have had success using the People Manager & Person Properties objects, but not the User ...
0
votes
1answer
14 views

2013 MySite - WebPart provides user properties

I'm currently branding a 2013 MySite host and to do so I access some user information via JSOM. EnsureUserProperties: function (callback) { /// <summary> /// Ensures that the ...
1
vote
0answers
19 views

Cannot update allowMembersEditMembership

I can't seem to update the setting on a group to allow members to edit members. This is my code: function setGroupsMembershipEditingMode(uri) { var context = new SP.ClientContext(appweburl); var ...
1
vote
1answer
56 views

Assigning Folder Permissions with JSOM

Is it possible to use JSOM to assign unique folder permissions? I found the SP.BasePermissions.set() method but can't seem to find much documentation on it. Much more out there using C# but ...
-2
votes
1answer
35 views

SharePoint WCF SOAP, Rest, AJAX

I need to know the following things: 1) How is SharePoint used with WCF, REST and SOAP. Any helpful links will be really appreciated. Thank you.
1
vote
1answer
32 views

Difference between ViewFields and Include, in JSOM

I am working on a solution where I am using JSOM, I got confused on to the usage of Include in when you load the items collection, and usage of to get which fields you want? What's the specific ...
0
votes
1answer
34 views

Get user Login from User or Group field

I have a list with User og Group field. I've retrieved item from it, now I need to get user's Login. By reading User or Group field I can get only user id and account name. here's my code: var ...
-1
votes
0answers
52 views

Javascripts Conflict

I have two scripts on my SharePoint page that has jQuery inside and JSOM. One of the script only works if the other script have not been added. I get this error code: Uncaught Error: The ...
0
votes
2answers
53 views

Modify list view with JSOM

How can I make fields invisible on my list view, all items? It is something wrong with my code now: it changes the view but the only field it is displaying is Title and Modified. I want to display ...
2
votes
1answer
53 views

How create Sharepoint online site with custom template?

I need to create site in SharePoint Online from SharePoint hosted app. I used code like this: var webCreationInfo = new SP.WebCreationInformation(); webCreationInfo.set_webTemplate('STS#0'); ...
0
votes
1answer
47 views

Pure clientside webpart for Office365

I want to build a pure clientside (angular) webpart for my own environment. I want to have as small of a footprint as possible (So please no app domain or sandboxed solution). It's necessairy this ...
0
votes
1answer
68 views

Hide Title Field

Im creating a sharepoint list with Javascript, now i want to hide the title field in the same process. How can i acchieve this?, i was trying to add a jslink , and in that document, hide the title ...
0
votes
1answer
23 views

Dynamically enable feature in NCSS via JSOM

My original goal was to dynamically enable the SiteFeed feature in a dynamically created publishing sub web. This has been accomplished and works like a charm. Information on how to do this was ...
3
votes
0answers
47 views

Replicate AllItems.aspx inline edit in custom page layout

I am attempting to replicate the inline editing features found in the allitems.aspx page in a custom page layout. For whatever reason the "new" and "edit" list options don't seem to be showing up. ...
0
votes
2answers
49 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 ...
1
vote
0answers
39 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: ...
1
vote
1answer
59 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
42 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
18 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
35 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
110 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
51 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
146 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
38 views

Updating an existing content type field link by JSOM

I have a content type and I would like to set some field links to hidden. The code runs perfectly, but for some reason, when I check in the UI if the field link is hidden, the changes are not applied. ...
2
votes
0answers
34 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
148 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
1answer
30 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
42 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
79 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
134 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
41 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
132 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
82 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
113 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
122 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
77 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
158 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
673 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
108 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
186 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
138 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
12 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
204 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
257 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
380 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 ...