JavaScript Object Model

learn more… | top users | synonyms

0
votes
1answer
16 views

Get publishing page url using CAML

I am retrieving pages using CAML, and doing for loop on the results like the following: function _onSucceed(){ var html=""; for(var i = 0; i <results.length; i++){ ...
0
votes
1answer
15 views

Cannot read property 'get_current' of undefined

I am using this code: "use strict" var BasicJSOM = window.BasicJSOM || {}; BasicJSOM.Crud = BasicJSOM.Crud || {}; $(function() { BasicJSOM.Crud.MainDemo = new BasicJSOM.Crud.Main(); ...
1
vote
2answers
23 views

JSOM List Item Field Values

This should be an easy one but for some reason the answer is escaping me. I am executing a query with joins that includes projected fields (fields from one of the joined lists) using JSOM. Using ...
0
votes
1answer
29 views

Cross SiteCollection call with JSOM not working

I got a problem and my brain says "yes you made no mistake" but it doesn't work. Here is my problem: I have a SharePoint hosted App which has "Tenant read" permissions in the App Manifest. That ...
0
votes
2answers
32 views

Is it possible to refer to a field hidden in current view from JSLink attached to current view?

I have the following JavaScript code attached to List's JSLink property: (function () { var coloringFieldContext = {}; coloringFieldContext.Templates = {}; ...
0
votes
0answers
9 views

List all workflows with WorkflowServices throws exception. GetWorkflowDeploymentService returns null

I try to list all site workflows. I followed several examples and try to get the workflows by using CSOM and JSOM. This always fails with the error message: Cannot invoke method or retrieve ...
2
votes
2answers
34 views

Is there any way to retrieve a Web by title using SharePoint 2013 JSOM without using the enumerator?

I need to get a subweb with a particular title using JSOM. So far, the only way I can see to do this would be to use code similar to the following: function getStuff() { var oWebsite = ...
1
vote
2answers
20 views

Reasonable way to get custom webpart properties via jsom?

I need to fetch some of the custom properties of my webpart from the front-end. Currently, I'm using var oFile = context.get_web().getFileByServerRelativeUrl(_spPageContextInfo.serverRequestPath); ...
0
votes
0answers
9 views

Property missing from cswp results

We are trying to do a custom control/item template layout to render results for cross-site publishing. We have made a proof of concept on a development test site that is working. When we try to ...
-1
votes
1answer
40 views

Calls to WebProxy without an app context are not allowed

From SharePoint 2013's default.aspx page (https://somecompany-public.sharepoint.com/pages/default.aspx) I'm trying to call a RESTful json API which lives outside the SharePoint domain, but getting ...
0
votes
1answer
35 views

How to include custom fields in clientContext.load()?

Loading some list items via var lists = web.get_lists(); var list = lists.getByTitle(listTitle); var listItems = []; for (var i in len) { listItems[i] = list.getItemById(itemIds[i]); ...
0
votes
1answer
20 views

Does JSOM offer an equivalent to SPQuery.CalendarDate?

I'm trying to get recurring items for a specific month from a list. Using the following, I can get the events for the current month: <Query> <Where> ...
0
votes
1answer
18 views

List.getItems(query) returning too many results [duplicate]

I have the below sample CAML query that I built using the SPCAMLQueryHelper: <Query> <Where> <And> <Geq> <FieldRef Name="EndDate" ...
1
vote
1answer
61 views

Getting TermSet for a different locale using JSOM

I'm trying to pull back the labels from a term store for a different locale in SharePoint Online. So I have installed the different language packs in the term store: And then I have added a TermSet ...
0
votes
1answer
28 views

How to get the URL of an item's parent web in JavaScript?

Given an absolute URL to an item, like: http://server/sites/mysite/myweb/Lists/MyList/DispForm.aspx?ID=1 or the absolute URL to the item's parent list, like: ...
-1
votes
0answers
19 views

not getting getWebRelativeFriendlyUrl using sp.publishing.js. Same for getAllParentTerms

I am not getting getWebRelativeFriendlyUrl using sp.publishing.js. Same for getAllParentTerms. Code below: function getURL() { // Create an instance of the current context to return context ...
0
votes
1answer
11 views

How to display latest created image from a picture library in a page?

There's a page where i need to show the latest created/uploaded image from a picture library. I did the following URL to retrieve that information to me (in JSOM): ...
2
votes
1answer
92 views

How to correctly pass extra properties to clientContext.load function

I have created a generic function which returns a list with only selected properties as shown: var getList = function (listTitle, properties) { var deferred = $.Deferred(); var ...
0
votes
2answers
49 views

fetch of all items from a list

I have an Announcement list in SharePoint site,I need to show all announcement in homepage,I am following msdn code sample to retrieve items from the list,But only last item will be display. function ...
0
votes
1answer
38 views

JSOM context newly created id reference when creating more than one item

I am using the COM JavaScript/jQuery to get, create & update some list items. I have two lists and every time I create a new item in one list, the newly created id is something that I want to grab ...
1
vote
1answer
33 views

consuming external web services(https) in share point hosted apps resulting cross-domain issue

We are not able to consume external web services deployed in a separate domain from sharepoint hosted apps,using jquery ajax. Thanks in advance . Thanks, HARI
0
votes
1answer
66 views

Add SP Group to folder using JSOM

Is it possible to add a SharePoint Group to a library folder using JSOM in Office 365? I'm using a script editor webpart on an aspx page to run the code. I managed to create SP Group, create folders, ...
1
vote
1answer
20 views

JSOM - ListItem from 'GetFileByRelativeUrl' returns System.ArgumentException

I'm trying to retrieve the corresponding ListItem from a page layout in the master page gallery using JSOM. I'm using the same approach that Vadim provides in this question, JSOM - get listitem by ...
1
vote
0answers
22 views

Get the last rated item in a SharePoint list

we have a SharePoint list with social rating feature enabled. On the homepage I want to display the "Latest Voted Item" of that list. Is it possible to get the last rated items in a SharePoint list ...
0
votes
2answers
45 views

JSOM and UTC conversion

I'm using client Object Model to filter a list and display an event date. When displayed I see a UTC date format. How can this be converted to UK date format using Javascript object model? Is it ...
3
votes
2answers
93 views

Client Side Rendering with Async dependencies

In my display template I want to render a field in different ways based on the user's group membership. The information about the group membership comes from an async ajax call (jsom or rest) What I ...
0
votes
0answers
10 views

Show custom list from host web

I am developing sharepoint hosted app.I have custom list on host web.Is is possible to show that custom lists default view into app's page. I want to use OOTB functionality like add ,edit and delete ...
0
votes
1answer
38 views

cannot retrieve data from lookup column

I'm trying to retrieve a lookup field using : var lookup = ($(this).attr("ows_shARePublishTo_x003a_shAReSiteUR")); Other columns seem to work fine, including another lookup column The column name ...
1
vote
2answers
140 views

Get userProfile mail by SP.FieldUserValue

What I want Simply - the user's profile information to obtain the mail adress. What I have A SP.FieldUserValue object filled with the user which mail I want to obtain. Approach MailContact: ...
0
votes
1answer
32 views

How to Get list of site collections in a web application using JSOM

I have got a requirement like want to fetch the details of all the site collections in a web application either using JSOM or .net managed client object model? Please provide me those details. ...
0
votes
1answer
44 views

Multiple Asynchronous query chaining

I have a Sharepoint 2013 application that has multiple (3) ExecuteQueryAsync calls in 3 different functions. Two of them are referring to the Project Server project context, and one is referring to ...
1
vote
0answers
23 views

How to create multiple fields using REST query

According to MSDN, we can create field like below.. $.ajax({ url: "http://<site url>/_api/web/lists(guid'da58632f-faf0-4a78-8219-99c307747741') /fields", type: "POST", data: "{ ...
1
vote
0answers
38 views

How to get Title Resource from a View with JSOM or REST?

I am able to get title/name resource from lists, content types and fields. However, I'm not able to get title resource from views. I'm not sure how well documented this is, but this is how I get ...
-1
votes
1answer
37 views

Remove User from Security Group Using JSOM

I'm trying to remove a user from a SharePoint 2010 group using JSOM, but not having much luck. I've been trying to adapt the script on this page - ...
1
vote
1answer
44 views

Error in accessing Office 365 Developer site's URL in SharePoint App [JSOM]

I have created a SharePoint App for my Office 365 Developer site. The app is throwing an error when trying to access the Site's url. var context = SP.ClientContext.get_current(); var web = ...
1
vote
0answers
50 views

Get ContentType by “internal name” through REST/JSOM

I understand content types has nothing equivalent to fields internal name, they only have Name, which is like a title. This can be changed, and alters between locales. My impression is that the safe ...
0
votes
0answers
55 views

How to create an Enterprise custom field programmatically for Project Server

I want a Sharepoint 2013 app to create programmatically an Enterprise Custom Field when it runs for the first time. I fiddled around with the following code snippet, but it's not working var ...
2
votes
2answers
268 views

Dynamically get default display form url in sharepoint 2013 by REST or JSOM

How can I get default display form url of sharepoint list item via Rest or JSOM. I found the result by link: How to get the Display Form URL, using REST But the XML returns all of the display form ...
0
votes
0answers
31 views

Remote access development

I'm relatively new and have tried to search posts regarding this problem but I'm not sure whether I'm hitting the right sites. The scenario is this. I have a sharepoint 2013 installed on ...
0
votes
1answer
60 views

query calender list so user cant book same date and time

Update var context= SP.ClientContext.get_current(); var web = context.get_web(); var list = web.get_lists(); var targetList; function createItem() { targetList = ...
0
votes
1answer
59 views

Get person profile properties by name

Is there a quick solution of getting someone's user profile given just their name? I want to get the mysites url of the user and I only have their name.
0
votes
1answer
74 views

Error Unable to get property 'getEnumerator' of undefined or null reference

Getting the following error when running my script: Unable to get property 'getEnumerator' of undefined or null reference My code : NBSFeedbackEditInbox.FeedbackRemove = (function () { var ...
0
votes
2answers
40 views

client context not initialized error

I have a client context not initialized error and I have no clue how to fix it I feel like I have tried everything. Would appreciate some help Here is my code : Code that gets the list: var SFW = ...
0
votes
1answer
64 views

CSOM and JSOM when to use

Hi Just a quick question on when to use CSOM and JSOM. I've created a page using SPD and want to retrieve list items. I assume I should use JSOM for this however can I use CSOM code also? If I ...
0
votes
1answer
115 views

new SP.ClientContext(siteUrl); — Object does not support this action

var siteUrl='sites/mysite'; function wait(){ var clientContext = new SP.ClientContext(siteUrl); ....more code.... } SP.SOD.executeFunc('sp.js', 'SP.ClientContext', wait()); ERROR: ...
0
votes
1answer
65 views

CAML Query works in U2U CAML Query Builder, but not SharePoint

I built a CAML query using U2U CAML Query Builder and it works when I execute it in the builder, but when I go to JSOM in SharePoint, I get the entire list and none of the filters from the query work. ...
0
votes
1answer
45 views

Sharepoint Online Public Website Forms

I have several forms that need to be sent to an email when filled. How do i do this to enable anonymous users to do that, It only allows authenticated users to submit the form via JSOM
0
votes
0answers
36 views

Import search configuration in JSOM

Does somebody know if it's possible to import a search configuration XML file to a SharePoint 2013 site collection in JSOM? I am trying to do so, but didn't find anything relevant: everything I find ...
0
votes
2answers
100 views

JSOM default groups when creating subsite

function createWebsite(siteName, site) { this.clientContext = typeof site !== 'undefined' ? new SP.ClientContext(site) : SP.ClientContext.get_current(); this.oWebsite = ...
1
vote
1answer
73 views

init.js Obect expected error with SP.SOD.executeOrDelayUntilScriptLoaded

I am using SP.SOD.executeOrDelayUntilScriptLoaded as follows SP.SOD.executeOrDelayUntilScriptLoaded(NBSFeedbackEditInbox.FeedbackRemove.removemessage(itemid), "sp.js"); Yet I am getting an error ...