JavaScript Object Model

learn more… | top users | synonyms

1
vote
1answer
15 views

What is difference between executefunc and executeordelayuntilscriptloaded?

Execute func: SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function () { console.log("Initiating SP.ClientContext") }); ExecuteOrDelayUntilScriptLoaded: ...
1
vote
1answer
30 views

Reindex search results (Content Search Web Part, 2013)

I will just leave this here, since it helped us a lot: We have a Content Search Web part with custom Display Templates with link to edit item. After user edit item, we want to refresh the search ...
1
vote
2answers
78 views

Add List Item with managed metadata field through JSOM

I have a simple scenario, where I've a list with some custom content types. Among other fields, i have a managed metadata field. I want to add a new item in the list through JSOM and this is where I ...
0
votes
0answers
16 views

Set Web Part connection via client side code

Is there a way to set up a Web Part connection using client side code? I am open to any client side solution: SOAP services, JSOM, REST, other...
0
votes
3answers
85 views

executeQueryAsync in for loop

Lets say i have a function that has a for loop in it. I need to loop it becouse i have an array that i need to get items dynamically from: newsArray[i].Group. In the function Success , i will be ...
0
votes
1answer
23 views

Retrieve People or Group Field to string instead of Object

Iam retrieving an item from my list with jsom in a script editor. i retrieve a field wich is the type of: user or group field. I want to display the group name i retrieve. I tryied to parse to json, ...
2
votes
1answer
37 views

Get file ID after upload using JSOM

I use JSOM to upload document in library. I use this JS: var file; var fileCreateInfo; function CreateFile() { // Ensure the HTML5 FileReader API is supported if (window.FileReader) { ...
1
vote
2answers
40 views

how can we get the current url via JSOM on masterpage?

We have masterpage which is set programatically to all sites on all site collections. On masterpage we want to redirect user based on a value to a page in layouts folder. I have read that the ...
0
votes
1answer
59 views

How to Get User Active Directory Groups in Sharepoint Online

I can't find any documentation or a way to find if a user belongs to an AD group with Javascript neither with the REST API or with the client model JSOM. I have a page in a Sharepoint site and I want ...
1
vote
1answer
23 views

SharePoint 2013 navigation permissions

I have setup a metadata navigation. But now i only want sites to be visible for users that are members on this sites. Security triming does not works with metadata navigation, i was thinking some ...
0
votes
1answer
46 views

collection has not been initialized after dialog modal closes

I have two JS scripts on my SharePoint 2010 page, one in the master page, one in a forms web part (I've attempted this with a CEWP as well). Both are in unique name spaces (My.Tabs and ...
1
vote
0answers
29 views

Jsom not working when user is reader

I am using following code to get terms from a termset in MMS. It is a office 365 solution and some of users is external users which have read permissions. The javascript doesn't work when user is ...
2
votes
3answers
86 views

CSOM Change Field Name

I am trying to change the list column name. Here is my code, it isn't working. I added a content editor web part with this code: <script type="text/javascript"> //js ref </script> ...
0
votes
1answer
48 views

getTermSetsByName does not return an instance of TermSet

Following code does not work correctly var clientContext = new SP.ClientContext.get_current(); var tSession = SP.Taxonomy.TaxonomySession.getTaxonomySession(clientContext); var ts = ...
1
vote
2answers
59 views

Error while accessing the User profile properties via JS code

Code gives error 2 times out of 10 attempts to refresh the page. We get error as: Request failed, unexpected responce from server. The status code of response is '0'. The status text of ...
0
votes
1answer
44 views

JSOM function get_isSiteAdmin() is always false

I'm trying to get the property "IsSiteAdmin" from a user object in Javascript JSOM. The app I am programming needs to be able to distinguish normal users from Administrators. function ...
4
votes
1answer
55 views

setting page layout using JSOM

I want to change page layout for some of my publishing pages using a SharePoint-Hosted app. Is there a way to changing (setting) page layout to a publishing page using JavaScript?
3
votes
1answer
112 views

Get quick launch using CSOM (JavaScript)

On my publishing site I have changed its current navigation (quick launch) to use structural navigation, showing all items under current site. I see that the quick launch shows pages and sub sites for ...
0
votes
1answer
23 views

getting sub terms from mms using JSOM and jquery deferred

I am trying to retrieve top navigation (terms and their sub terms) from MMS using JSOM and JQuery deferred. I need to have nested deferred because terms has sub terms. following is my code. ...
2
votes
1answer
67 views

Create Multiple List Items with One Function

Is it possible to create multiple list items with one function in JavaScript / ECMAScript? I know that a single item can be created with the code below, but would like to know if it is possible to ...
4
votes
2answers
271 views

Get a users Name from their ID

As part of my Sharepoint hosted App i am using a list which contains a Person or Group. I am getting the ID of the person by using the following. var ApproverID = ...
1
vote
3answers
279 views

There is no trusted URLs configured for the app deployment on Client side People Picker

I've built and been using a Sharepoint hosted app which uses a Client side people picker which all worked correctly until today. No when using them I get the following error. There is no trusted ...
3
votes
2answers
69 views

Retrieve site collection quota and used storage from REST or JSOM

Is there a way to retrieve the amount of storage used and the quota limit for the Site Collection using the JSOM client or the REST web services?
0
votes
1answer
38 views

Getting header and footer externally using JSOM

We have a SharePoint 2013 site and another associated asp.net website. We would like to build the header(including top nav) and footer of the website so that it matches the header and footer of the ...
2
votes
1answer
44 views

Update AuthorId in sharepoint 2013 Blog

In a sharepoint 2013 Blog site I am posting a post on behalf of few senior members of our organization. As usual it shows my name in posted by field. Is there a way to change that programatically ...
0
votes
1answer
28 views

get answers for a blog post using csom

I am trying to find out how to get answers for a blog post in a community site using javascript or csom. I made a search on the Internet unfortunately didn't find anything.
0
votes
0answers
15 views

Replicate the User availability Status using client code code

Having completed another Sharepoint hosted 2013 app i'm looking at ways to improve it and I've been looking for some example code around the User availability Status which you see in OTB lists ...
4
votes
2answers
150 views

How to return all user profiles

I need to query the entire user profile store and do multiple operations such as filtering based on one user profile property, sorting by another, and grouping on yet another. Is this possible using ...
0
votes
1answer
68 views

Get SharePoint User JSOM

I want to get a User via JSOM. The User is not the current user. The object I want to get should be SP.User (not String or anything) I want to get the User by asking for his login ...
0
votes
2answers
223 views

Get a list View GUID by View name using JSOM

I have the following code in which i trying to get both the list GUID (working) and the list View GUID by the name of the view, which is not working. function getLists() { lists = web.get_lists(); ...
1
vote
1answer
107 views

Replicate the Export to excel button in javascript for a JSOM app

I have completed my first sharepoint 2013 app (sharepoint hosted) where I'm using my own code to display list data etc rather than use any OTB pages/functionality. The one feature I want to include ...
3
votes
0answers
86 views

Deploying and Installing Sharepoint apps into App catalog using CSOM

Can anyone suggest me on how to use SP.AppCatalog() in JSOM or CSOM and get the all apps in AppCatalog, Not AppInstances..
0
votes
0answers
13 views

When clicked on Napa app it should displayed similar to JQuery.lightbox

I want to change my display of NAPA app, When I click on my app it should display similar to Jquery.lightbox , I think it is achievable but Where should this be implemented? Need your suggestions.. ...
0
votes
0answers
26 views

Get my Current GeoLocation and also to get directions using Navigation in SharePoint 2013

I want to start with getting current geo location from my app in sharepoint 2013 and also to get the directions of the location I wish to go... Will I be able to implement it using NAPA app in SP 2013 ...
1
vote
1answer
265 views

Using Lookup Value in a JS Link Context - SP2013 Foundation

I am tasked with styling some lists for our Intranet Home Page. While I was fairly capable of this in SharePoint 2010 using Data Views and XSLT, I am trying to learn the new (and I think better) way ...
0
votes
0answers
24 views

Add link to Icon in ChromeLoader

I'm using the following well documented Chromeloader.js on my client side 2013 app. i want to wrap a link around the "appIconUrl", can i do this for the JS or will it need to be done on the HTML page? ...
0
votes
2answers
309 views

Get Icon URL and filename of document library file using JSOM in office 365 app

I have an app that includes a Document Library...using my normal code to display the list but keep getting a null on the field...i've tried rptDocsListItem1.get_item("xd_ProgID") and ...
0
votes
1answer
30 views

Updating an Sharepoint 2013 app (sharepoint hosted)

I have developed an app and I'm trying to get my head round what happens in the update process. My app contains several lists some of which the user can update. If they then update their app with my ...
0
votes
2answers
404 views

Retrieving List Items using REST services in NAPA app

I tried retrieving List items from the List(Marketplace) I created in the Hostweb using REST services in NAPA app , Set the permissions for Web, Site Collection, List to Full Control, Please helpe me ...
3
votes
1answer
400 views

How to get Social Comment in SharePoint 2013 using JavaScript (REST) or Search?

I have added a Noteboard Web Part in my page. Now user is adding comments in Noteboard Web Part. I want those comments count. How can I get it using JavaScript? I am using SharePoint 2013. Is there ...
0
votes
0answers
58 views

How to Install App from sharepoint hosted app to sub sites

Here is my function, but it doesn't work: var context = new SP.ClientContext(appweburl); var factory = new SP.ProxyWebRequestExecutorFactory(appweburl); ...
1
vote
1answer
221 views

How do we create Sub Site using JavaScript object module

My using following script to create Sub site. type="text/javascript"> type="text/javascript" src="/_layouts/15/sp.runtime.js"> type="text/javascript" ...
1
vote
1answer
618 views

Get Related Item ID from a workflow task list

using JSOM i am displaying a list of a workflow task...in order to allow my users to approve the task i need to get the ID of the related item. I'm guessing this is going to be in the Related Item ...
0
votes
0answers
56 views

Save people picker info to list (client side)

I'm building a office 365 app so its all client side and I've implemented the people picker DIV method as discussed here, my people picker is part of a form which submits to a list but I'm not sure ...
0
votes
1answer
76 views

SP2013 - Call to display host web list data only works once

I'm building a SP2013 App. I able to successfully pull back list data from the host web with with the following code that loads the "sharePointReadyToGetReviews()" function through an on-load ...
3
votes
2answers
240 views

How do I programatically change the default value of, or remove from default view, title column using javascript?

Using the JSOM in SharePoint 2010, if I am creating lists programmatically using something like: this.myField= oList.get_fields().addFieldAsXml('<Field DisplayName=\'Key\' Type=\'Text\' />', ...
0
votes
1answer
154 views

Return JSON rather than XML in a Sharepoint 2013 App (JSOM)

Is it possible to return JSON when using the following code. Trying to integrate DynaTable into app to handle all the sorting and filtering and I think JSON might get it to work. // This function ...
0
votes
2answers
115 views

Reading a list in javascript

I have a list which i want to fetch at the front end using javascript based on some user inputs. The list has 3 columns - 'Name', 'Branch' and 'Age', and the list is named 'Students'. Now if the ...
1
vote
1answer
87 views

Remote web application accessing SharePoint with current user's credentials

Can we access SharePoint from a remote application with current user's credentials when user opens a remote page which has server-side CSOM user opens a remote page which has a server-side WCF ...
2
votes
0answers
256 views

SharePoint 2013: Using JSOM, get a list of all sites user has access too

I was looking at the JSOM documentation, but couldn't find a nice way to spin through all site collection and sites to show a user what they have read access to. Is this possible using JSOM and a ...