17

You can use Sharepoint Client Object Model for this. Here is how to do it on the current web: function CheckPermissionOnWeb() { context = new SP.ClientContext.get_current(); web = context.get_web(); this._currentUser = web.get_currentUser(); context.load(this._currentUser); context.load(web,'EffectiveBasePermissions'); context....


13

Your <RowLimit> tag is inside <Query> tag which is wrong, it should be out side the <Query> and inside <View>. Try below camlQuery = "<View><Query><CalendarDate>" + calendarDate + "</CalendarDate><Where><DateRangesOverlap><FieldRef Name='EventDate' /><FieldRef Name='EndDate' /><...


12

It is more a caml question than an SPServices question. Often one uses or and and operators to combine multiple values, which, like @rjcp3 said, can be messy. There is another operator, less known, IN operator to choose a range of values (see the xml example below). To simplify the creation of CAML queries in javascript, I'd recommend SharePoint ...


11

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


10

I very recently had the same issue with Nintex Workflow 2010: It wouldn't install properly from my App server because this service was turned off. Other than that, yes it's a good way to turn an application server into a true application server, and prevent it from running and serving the content web applications and IIS sites. Have a look at the "...


9

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 = []; $(...


7

Try this: $().SPServices({ operation: "GetUserLoginFromEmail", emailXml: "<Users><User Email='jack_harry@goodworld.net'/></Users>", completefunc: function (xData, Status) { $(xData.responseXML).find("User").each(function() { $(this).attr("DisplayName"); }) } });


7

If you are using jQuery 1.7+, the syntax you are using to find the z:row elements no longer works. Use the SPFilterNode function instead.


7

Use get_id to get the GUID var value = SP.Web.get_id(); Example usage: <script type="text/javascript"> ExecuteOrDelayUntilScriptLoaded(getSite, "sp.js"); var context = null; var web = null; function getSite() { context = new SP.ClientContext.get_current(); web = context.get_web(); context.load(web); ...


7

Eric Alexander is right on both of his points, but I don't think that's why you're getting the error that SPServices is undefined. Is jQuery getting loaded somewhere else on the page? I have seen this happen when there's another link to load jQuery somewhere lower on the page than the link to SPServices. Then jQuery re-loads itself and loses the ...


6

I believe that you are looking for this: $().SPServices({ operation: "GetVersionCollection", async: false, strlistID: "tester", strlistItemID: 1, strFieldName: "Information", completefunc: function (xData, Status) { $(xData.responseText).find("Version").each(function(i) { console.log("Name: " + $(this).attr("Information") + " Modified: ...


6

This blog post from Microsoft is highly linked to and describes what you want to do. I've used it before, these days I typically use jQuery and SPServices. Setting lookups typically requires you to pass in the Lookup ID value or the ID;Descriptor. Here's an actual example from a site of mine, it's setting a person/group field, not a lookup though. You ...


6

I had the same need and built my own jQuery widget... you can read more about it here: http://paultavares.wordpress.com/2012/04/28/sharepoint-ui-widgets-upload-and-pickusers/ The zip file has a self-contained demo that demonstrate the use of the upload plugin. Make sure you have all the prerequisites in place. Hope you find a good use for it. Paul.


6

Have you considered something like this? $().SPServices({ operation: "Query", queryXml: queryText, completefunc: function(xdata, status){ //code to set your variables searchComplete(xdata, status, yourVariables); } }); function searchComplete(xdata, status, yourVariables) { }


6

I could not find any good way to do it with IE8 or IE9, so I utilized the OOB AttachFile.aspx form: (I am using SPService to get query string & I am adding input control dynamically with JQuery) function readyCall() { //Get Query String var queryString = $().SPServices.SPGetQueryString(); //Tasks List ID (i.e. 0A347169-CE79-4B7F-B561-...


6

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.


6

It's really not an SPServices thing, per se, but a JavaScript/jQuery thing. Many functions give you callback values, and xData and Status are just examples of that. As Eric says, you can use any name you like, but most people seem to stick with xData and Status, as that's what I use in all of the examples. (I borrowed those names from somewhere else back in ...


6

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


6

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.


6

I have used the following javascript to set people pickers on new/edit forms in SP2013: First you need to get the loginName for the user, you could extract the ID from the value you got and use it to get the loginName through a REST query: var requestUri = _spPageContextInfo.webAbsoluteUrl + "/_api/web/getuserbyid(" + userid + ")"; $.ajax({ url : ...


5

You could solve it with a working crossbrowser solution by replacing your string from: $(xData.responseXML).find("[nodeName=z:row]").each(function() to: $(xData.responseXML).find("z\\:row, row").each(function() and then it will work in all browsers ;)


5

Finally got it working after some changes in IIS under authentication section for "_vti_bin" directory. Set "Anonymous Authentication" to Disabled and "Basic Authentication" to "Enabled". For time being this setting worked for me; not sure whether this is going to work every time.


5

You'll want to add a CAMLQuery option to your GetListItems call: CAMLQueryOptions: "<QueryOptions><ViewAttributes Scope="Recursive"/></QueryOptions>", This will result in the recursive querying of all the subfolders.


5

Sorry for not getting back to you sooner. I was in training and then extremely ill the last 30ish hours. Take a look at this post by Josh McCarty: http://joshmccarty.com/2011/11/sharepoint-jquery-and-fullcalendar%E2%80%94now-with-spservices/, wherein he followed some details I posted in this discussion on the SPServices codeplex site: http://spservices....


5

You have to "roll your own check". User GetListItems to see if there is an existing item and then conditionally either add a new item or update the existing one.


5

You can specify the Ascending=False as an attribute of the FieldRef in the OrderBy element. $().SPServices({ operation: "GetListItems", async: false, listName: "EmployeeList", CAMLViewFields: "<ViewFields></ViewFields>", CAMLQuery: "<Query><Where><Eq><FieldRef Name='EmployeeID'/><Value Type='Text'&...


5

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, listName: ...


5

Based on the answer of Aboba I tweaked the script a little bit. It dynamically builds the new URL and loops through all list items to get all item ID's. Therefore it skips items that have already been deleted. If the last item has been reached, the button is hidden. I added the code in a code snippet web part on the display & editform of the library. ...


5

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


5

Now that you have it working, you have to bind it your title field. Your function would become something like: $(function() { $("input[title='Title']").autocomplete({ source: availableTags }); });


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