Tag Info

Hot answers tagged

4

You could perform this via CSOM/REST API. Use SP.Web.getFileByServerRelativeUrl Method to request File object and specify SP.File.listItemAllFields property to load list item field values for the list item corresponding to the file: var ctx = SP.ClientContext.get_current(); var file = ctx.get_web().getFileByServerRelativeUrl(url); //get file ...


4

CAMLViewFields: '<ViewFields>'+ '<FieldRef Name="NamePage" />'+ '<FieldRef Name="Date" />'+ '<FieldRef Name="Title" />'+ '<ViewFields>' should be CAMLViewFields: '<ViewFields>'+ '<FieldRef Name="NamePage" />'+ '<FieldRef ...


3

The trick is to set the CAMLQueryOptions so that you get all the items regardless of what folder they are in. It's sort of like the "folderless" option in a view's settings. CAMLQueryOptions: "<QueryOptions><ViewAttributes Scope='RecursiveAll' /></QueryOptions>"; The GetListItems documentation on MSDN is a little light on these options. ...


3

It basically depends on your personal experience with the different technologies, there are many opinions out there with lots of pros and cons that may or may not be relevant to you. I personally very much dislike pure javascript CSOM because of all the context loading and SPServices was a good abstraction for that, but eversince I've used REST in SP2013 I ...


3

Pros A wide range of SharePoint functionality is exposed with the SOAP Web Services, much of which is not available in CSOM Allows anonymous access (assuming it is enabled for the underlying objects) Works cross-site and cross-domain, assuming that the authentication model you are using allows it Simpler syntax than the CSOM. Simply pass the required ...


3

xData represents the returned data, it could be replaced with foo or blah or whatever you'd like. Status represents the status of operation, off hand I don't remember if it is the status code (like 200) or status text (like success). I rarely use status and rely on the xdata returned in doing logic checking.


3

How to retrieve attachment files using SPServices function getAttachmentFiles(listName,listItemId,complete) { $().SPServices({ operation: "GetAttachmentCollection", async: false, listName: listName, ID: listItemId, completefunc: function(xData, Status) { var attachmentFileUrls = []; ...


3

You cannot do impersonation or permission elevation in client side object model. http://sympmarc.com/2011/05/27/elevating-permissions-with-sharepoints-web-services/ http://spservices.codeplex.com/discussions/392133


3

Since you don't need to use the SPServices library, you can accomplish this via REST and the moveTo() method. The following should work: var url = "/_api/Web/Lists/getByTitle('My List Name')/Items", qs = "?$filter=Attachments eq 1&$select=ID,Author/Title,*&$expand=Author"; $.ajax( { url : siteUrl + url + qs, type : 'GET', headers : { ...


3

It looks like you omitted parentColumn and childColumn. This needs to be present for the script to work, otherwise it doesn't know what fields on the form to manipulate. parentColumn The DisplayName of the parent column in the form childColumn The DisplayName of the child column in the form Correct code should be: ...


2

I assume you have a customized page where these users enter the User's name and then you replace all instances of that name with a new one... To do this client side, you need to use the 'SearchPrincipals" webservice. It will return a list of possible matches based on a name/email/login name. You might also be interested in this client side People Picker ...


2

Have you tried loading the user first? Like this: 'use strict'; var context = SP.ClientContext.get_current(); var user = context.get_web().get_currentUser(); // Load user here: context.load(user); var myApp = angular.module('myApp', []); function TodoCtrl($scope, $SharePointJSOMService) { // I'm not familiar with the provider $SharePointJSOMService // ...


2

Without seeing the working query it's difficult to compare the two. When troubleshooting it can be helpful to replace "<Eq>" with "<Neq>" or with "<Contains>" If no results are returned then it may alert you to a problem elsewhere.


2

The dataview web part is executed server side, so you can't use jQuery to manipulate the SelectCommand. You would need to remove rows from the DOM with jQuery after the web part has loaded. I would use jQuery to hide the web part initially. Then, make your SPServices call to get the user's Office. Then iterate over each row of the table and if the Office ...


2

Add this to your SPServices call: CAMLQueryOptions: '<QueryOptions><ViewAttributes Scope="Recursive"/></QueryOptions>', So: SP.SOD.executeOrDelayUntilScriptLoaded( 'SP.UserProfiles.js', "~sitecollection/Style%20Library/Scripts/jquery.SPServices-2013.01.min.js"); SP.SOD.executeFunc('SP.js', 'SP.ClientContext'); $(function() { var ...


2

It looks like you need to add this in before your completefunc to force ordering by Group then Title in the results returned, if not you need to do your own sorting after getting the results back: CAMLQuery: "<Query><OrderBy><FieldRef Name='Group' /><FieldRef Name='Title' /></OrderBy></Query>", Edit: I have verified ...


2

I think you'd need to do it in 2 calls. First, you'd have to query your list with a GetListItems call with CAML query like: <ViewFields> <FieldRef Name='ID' /> </ViewFields> <Where> <Eq> <FieldRef Name='LinkFilename' /> <Value Type='Computed'>file.txt</Value> ...


2

Edit: on MDS... If you would like to continue to use the Minimal Download Strategy (MDS) and client-side rendering with JSlink you'll need to modify the solution below; please see my answer to a similar question here for more information: Client-side rendering (JS Link) status changes in sharepoint list I figured out how to do this using client side ...


2

The SharePoint services, the problem with answering this question lies in the word 'the'. SharePoint is a big application or rather a mix of several applications. Thus it supplies both Web/WCF Services like the ones that the Client object Model uses it supplies REST services which is also web based. But it also has several windows based services like the ...


2

In the SPServices library, you just need to add an option like this in your GetListItems configuration: CAMLRowLimit: 6 Marc then tacks this onto the appropriate place in the dynamically built CAML query to get your data.


2

You could use AddUserToGroup operation for that purpose, for example: $().SPServices({ operation: "AddUserToGroup", groupName: groupName, userLoginName: userLoginName, completefunc: function(data,status){ //... } }); References Managing SharePoint Site User Memberships in Multiple Groups Using SPServices


2

It could be done by leveraging SharePoint REST services. In SharePoint 2013 workflows was introduced a new action named Call HTTP Web Service. This action is flexible enough to make requests to a variety web services including SharePoint REST service. The following REST request demonstrates how to determine whether Folder contains items: ...


2

Improving the code suggested by @wjervis, you can change the header of ajax request to: headers: {          'accept': 'application/json;odata=verbose'      } This way it will return a Json response, that I think it is more easy to handle. You can get the length of the response by doing: data.d.results.length Additionally, you can put one more "expand" ...


2

This is a known issue of IE7/8, see for example here or here: ECMA-262 r3 does not define any date formats. Passing string values to the Date constructor or Date.parse has implementation-dependent outcome. It is best avoided You could consider the following solutions: Use custom parseISO8601 function or Date.fromISO function to parse string to ...


2

You can expand the user field using following code CAMLQueryOptions: "<QueryOptions><ExpandUserField>True</ExpandUserField></QueryOptions>" Now you can extract username in success method by using string manipulation.


2

Yes you need to place following query option CAMLQueryOptions: "<QueryOptions><ViewAttributes Scope="Recursive"/></QueryOptions>"


2

The whole Or section looks wrong, try using BIWUG CAML Designer to craft your query, then use that in your SPServices function. Also, you need to use the internal field names, not the web service returned fields (Description1 vs ows_Description1 etc). http://www.biwug.be/resources Typical nested Ors would look like this: <Where> <Or> ...


2

I don't think you use the correct columns' names. You're using the names as seen by the SharePoint search engine, not the internal names of the fields. For instance, ows_Title should be Title, etc. On the other side, I don't think the nested OR are wrong here, they're just up-side-down.


1

SharePoint 2010 Web Services uses Simple Object Access Protocol (SOAP) over HTTP and acts as a communications interface between client programs and SharePoint. SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use.


1

You can get the list url from the get_defaultViewUrl method... when you load the lists you need to use the include statement to retrieve the defaultViewUrl property (it isn't included with the list results by default). Change your context.load line to: context.load(lists, 'Include(Title,DefaultViewUrl)'); Then inside of your iterator loop you can use ...



Only top voted, non community-wiki answers of a minimum length are eligible