Tag Info

Hot answers tagged

5

I think the problem may be the console.log() line. With IE, (I believe) console is only available when the debugger is opened, thus an error is thrown if it is not. Replace console.log(Status) with alert(Status) and you hopefully will see it.


4

In order to return account name, email, and name instead of just the name, use: CAMLQueryOptions: "<QueryOptions><ExpandUserField>True</ExpandUserField></QueryOptions>" Refer SPServices GetListItems documentation for more details. Example: $().SPServices({ operation: "GetListItems", async: false, ...


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

Since you mentioned SPServices, below is demonstrated how to query list item by file name using GetListItems operation: function fileExists(webUrl,listName,fileName,result) { $().SPServices({ operation: "GetListItems", webURL: webUrl, listName: listName, CAMLQuery: "<Query><Where><Eq><FieldRef ...


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

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

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

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

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


2

So, that option number seven you pointed out above is jQuery Tokeninput. http://loopj.com/jquery-tokeninput/ I think you could wire that up fairly easily to work with your SharePoint list. Right now, when it needs to look up an item, it makes a request to a specified URL. I would just modify the source so that instead of calling an external URL to get ...


2

You could use SP.File.checkOutType property to determine whether document is checked out of a document library REST $.ajax({url: "/_api/web/getFileByServerRelativeUrl('" + docUrl + "')/checkOutType", headers: { "Accept": "application/json; odata=verbose" }, success: function(data) { if(data.d.CheckOutType == 0) { ...


2

Without knowing more information about your code, it's hard to make a suggestion. But what I would do is create a query to ListData.svc with the following filter: var queryString = "?$filter=Name eq '" + provisdionalName + "'"; var listUrl = "_vti_bin/Listdata.svc/YourList/$count" + queryString; $.ajax({ type: "GET", url: ...


2

i know the answer has been accepted, but to do this through code: add <SharePoint:SPGridView ID=”oGrid” runat=”server” AutoGenerateColumns=”true” > </SharePoint:SPGridView> a ebook on spgridview: ...


2

Yes, you can create Visual Web Parts in Visual Studio for SharePoint Look Create Visual Web Parts in SharePoint 2010 You can use ASP.NET Controls in your Visual Web Part, you can drop this Visual Web Part after deploying your solution to any SharePoint Page (Publishing Page, Web Part Page etc.) For showing list items you can either use GridView ASP.NET ...


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

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

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

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

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

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

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

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 : { ...


1

To do a batch update query where the IDs are not known, you need to use this action: SPUpdateMultipleListItems. Example from the documentation: $().SPServices.SPUpdateMultipleListItems({ listName: "States", CAMLQuery: "<Query><Where><Eq><FieldRef Name='Status'/><Value ...


1

With every page is associated client context (_spPageContextInfo object), which in turn contains webTitle property. This property stores current web title and the following example demonstrates how to generate fully qualified name of group: function resolveGroupName(groupName) { return _spPageContextInfo.webTitle + ' ' + groupName; } Usage ...


1

Your webURL isn't correct. It probably should be just http://myurl.com/project. You're pointing to the owssvr.dll services, which doesn't have any meaning in an SPServices context.



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