Tag Info

Hot answers tagged

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

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

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


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

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


2

Keep in mind that you're working client side here, so things are less "controls" at that point and more "collections of HTML elements and some script". I can't tell for certain what operation you're using in your SPServices call, but I assume it's GetListItems from the rest of your code. When you make that call, SPServices uses AJAX to query the server for ...


2

Your file references are wrong if it is giving you a 404 error. Move them to a document library and give the script the full URL to get it working before making it relative. Also, the reference to jQuery should come before the reference to SPServices.


2

SharePoint has already lots of icons available in the DOCICON.xml file (14-Hive at C:/Program Files/Common Files/Microsoft Shared/web server extensions/14/TEMPLATE/XML) Simplest way could be to load based on file extension "/_layouts/images/icXXX.gif (where icXXX, would be icdoc.gif, idpdf.gif, etc.)


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

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

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

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


1

Have you tried something like this? <Query> <Where> <Eq> <FieldRef Name='ID' /> <Value Type='Number'>{YourIdGoesHere}</Value> </Eq> </Where> <OrderBy><FieldRef Name='FileLeafRef' /></OrderBy> </Query> <ViewFields> <FieldRef Name='ID' ...


1

2013 SP.Web.getUserById() http://msdn.microsoft.com/en-us/library/office/jj247179(v=office.15).aspx or spservices GetUserProfileByGuid and GetUserProfileByIndex should work http://spservices.codeplex.com/wikipage?title=UserProfileService and another solution http://spservices.codeplex.com/discussions/262196 $.ajax({ url: ...


1

The following example demonstrates how to add error handling for CopyIntoItems operation in SPServices: completefunc: function(xData, Status) { var errorCode = $(xData.responseXML).find('CopyResult').attr('ErrorCode'); if (errorCode == "Unknown") { var errorMessage = $(xData.responseXML).find('CopyResult').attr('ErrorMessage'); ...


1

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


1

For some reason, although most people are able to use $(xData.responseXML).find("FieldInformation").each(function() I was having issues with it, so I used "responseText" in place of "responseXML". A user in the comments section helped me solve the issue privately. update: I found that this issue was simply a bug in jquery 1.9.1.. ...


1

Found it! Instead of just using the name of a list, I stored the GUID of the list in "Subscribed users" and fetched that one. I then unescape it using this: unescape(currentViewLLIB); I can now call the list in the second SPServices part. :)


1

You can have a look at my codeplex project SharePoint 2010 Autocomplete Lookup Field which is a custom lookup field that uses combination of JQuery and REST and it also supports multiple values. Additional filters can be specified using REST Query. There is 2013 version also available on codeplex.


1

One way to implement a lookup on a large list is to stuff your list data into a text file containing JSON and upload the file to SharePoint. Then, do your lookup to the JSON file to achieve the autocomplete. This is one way around the large list (and lookup) difficulties of SharePoint. Although it does add some overhead for updating the data and it's not as ...


1

This is quite likely the issue. If you are using sharepoint online this is a hard limit and Microsoft will block any operation that involves more than 5000 items. If you have an on premise environment you can increase this limit, just speak to your administrator.


1

You have an error in your script. It should be: // in your code it was /viewfields. it must be ViewFields CAMLViewFields: "<ViewFields><FieldRef Name='Body'/></ViewFields>", // the filter must be SPFilterNode("z:row") //without the []



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