Tag Info

Hot answers tagged

6

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

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

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

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


3

CAML joins, to my knowledge, only work on the server side. To mimic that on the client side, you have to make several calls, storing the results in objects or arrays, parsing through that, and making further calls. This isn't a limitation of SPServices, but the underlying web services themselves.


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

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

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


2

you are providing listID instead of List Name and could be the source of the issue listName: "{17C2EC72-7229-445D-87A1-38AE11051906}", //give list name here


1

Couldn't you refactor the SPServices call into another function, that takes the "area" value, "topic" value, and the list selector as parameters? You'd still be querying the list 24 times, but it will look a lot cleaner. $(document).ready(function () { QueryNewsList("highlights", "company", "#highlights1"); QueryNewsList("downfalls", "company", ...


1

SPServices uses the old SOAP service API, which although are deprecated, they continue to be a very fast API - especially for GetListItems... In your follow up answer above, you show a snippet of code calling SPServices in synchronous mode (async: false) - meaning: your entire browser will "freeze" until the request is returned from the server and your ...


1

Try this code $(document).ready(function(){ $().SPServices({ operation: "GetListItems", listName: "Project review", webUrl: "/internal/", async: false, CAMLQuery: "<Query><Where><Gt><FieldRef Name='Id'/><Value Type='Number'>0</Value></Gt></Where></Query>", ...


1

If the current user is part of the FARM ADMINISTRATORS group then the below code currentUser.get_loginName() will return Sharepoint\System. This is the expected behavior and you don't need to worry much. Try using a normal user account and you can see it returns the expected result. Alternatively you can also use currentUser.get_title()


1

SharePoint renders dropdowns differently in Internet Explorer depending on whether they have fewer than 20 options or 20+ options. (In Firefox, Chrome, and other browsers, SharePoint doesn’t give us this “benefit”.) You can use SPComplexToSimpleDropdown function as below: How Does It Work? The SPComplexToSimpleDropdown function works like this: When the ...


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



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