Tag Info

Hot answers tagged

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


4

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


4

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


4

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

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


3

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.


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

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

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

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

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

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

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


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.


2

It appears I was simply missing accurate domain information. My "user" variable changed to include the domain name and user name combined allowed me to finally remove a user from the group. function deleteClick(arrayPos){ var group = userArray[arrayPos][0]; //group name var user = userArray[arrayPos][1]; //user.name var domain = ...


2

You can write an event receiver for your list that handles permissions of the item. You should use ItemAdded event receiver. Some links event receivers: https://msdn.microsoft.com/en-us/library/office/ms437502(v=office.14).aspx https://msdn.microsoft.com/en-us/library/office/ms453149(v=office.14).aspx and link about managing permissions ...


2

You would need to store the domain\username in a variable and make a call to the GetUserProfileByName operation to then get the managers name. http://spservices.codeplex.com/wikipage?title=GetUserProfileByName $().SPServices({ operation: "GetUserProfileByName", async: false, AccountName: yourmanagerVariable, completefunc: function (xData, Status) { ...


1

Yes use SharePoint Rest Services and then calling: https://<weburl>/_api/Web/GetFolderByServerRelativeUrl('</sites/site/subsite/library>')/Folders Just loop through all the results and when ItemCount = 0 and Name of the folder is not equal to Forms(default in every library) send out an email. It does not list out the subfolders. Still ...


1

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


1

use some LDAP code to search for a usable field (if the UID in the document exists in some field in AD) Replace FIELD with your equivalent field. Replace DOMAIN with your domain like LDAP://example.corp: string sFilter = String.Format("(&(objectCategory=user)(objectClass=user)(FIELD={0}))", query); string adPath = "LDAP://DOMAIN"; using (DirectoryEntry ...



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