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


5

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


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


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

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

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


3

Mark, See if this can help you. If you are writing the custom code this can set you the starting point.


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

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

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

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

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

Try this jQuery().SPServices({ operation: "GetListItems", async: false, listName: listName, CAMLViewFields: "<ViewFields><FieldRef Name='Values'/></ViewFields>", completefunc: Function.createDelegate(this, callback) }); callback = function (xData, Status) { var values = new Array(); ...


1

One problem that can arise is running the Distributed cache on more than four servers. It's recommended to have them on four or less servers. http://technet.microsoft.com/en-us/library/jj891124%28v=office.15%29.aspx Also the UPS sync service can only run on one of the serves. Search Server should run with no issues, but the performance may suffer if you're ...


1

I think you should try using the completefunc property of SPDisplayRelatedInfo parameters to pass a function which runs your cleanup code. This will allow it to run after the request has been completed and the extra table has been added to the page. The document.ready() event is similar to a _spBodyOnLoad function in SharePoint. Both waits for the main ...


1

Ah! I found a solution! http://jasonscript.wordpress.com/2013/08/07/javascript-and-working-with-the-sharepoint-2013-people-picker/ Here is my working code: var PickerTitle = "Assigned To"; var PickerDiv = $('[id$="ClientPeoplePicker"][title="' + PickerTitle + '"]'); var PickerEditor = PickerDiv.find('[title="' + PickerTitle + '"]'); var PickerInstance = ...


1

You can use a GUID or the display name for the listName parameter in SPServices. Make sure you use the curly brackets in the GUID. var lookupFieldInternalName = "LookupOne"; $().SPServices({ operation: "GetList", listName: "{C1AA0A1F-8177-4D64-AC3F-FDCFB31EFCA5}", completefunc: function(xData, Status) { console.log(xData.responseText); ...



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