Tag Info

Hot answers tagged

9

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


9

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


6

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


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.


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

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"); }) } });


5

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.


5

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


5

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

My advice would be to use the CDATA escape, rather than replacing the offending characters one by one: <Query><Where><Eq><FieldRef Name="Title" /><Value Type="Text"><![CDATA[Value < 10]]></Value></Eq></Where></Query> That should cure most XML special character ills.


4

Have you ever used SPServices? This will allow you to do these calls without writing the soap stuff yourself. I use it and if for example I am populating a dropdown, I will sort the return and iterate using the jQuery each option and then check to see if it is unique by testing it against the last option in the iteration.


4

Leave it on, as it provides flexibility. You should already be directing traffic to your WFEs with DNS or a load balancer, so other servers won't have traffic hitting them. But leave it on. Down the road you'll need to perform some sort of troubleshooting, and this will come in handy. "Well, then turn it on when you need to!" I hear you say. The problem ...


4

There is no such thing as read vs. write access when securing a URL to a web service - You can reference the Web Service URL or you can't. The services themselves are implemented to enforce security just as if you were logged into the site through the browser. Without access to _vti_bin you are pretty much out of luck for any of the SharePoint Web Service ...


4

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.


4

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


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

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


3

Follow these steps: Create another view and change the default view to this view Set permissions for the list from List Settings as 'Limited Contribute - default view' for all users except admin. Edit: 3. Go to Site settings -> Permissions -> Permission levels and create a permission for only viewing the default view. If this does not help: Open the ...


3

You need to convert the special characters, see an example of code here: https://devspoint.wordpress.com/2011/01/07/two-quick-javascript-snippets-i-use-everyday/#comments SharePoint actually has a built-in function for that, called STSHtmlEncode (cf. my comment in the above link).


3

It is not possible to get distinct values directly from the GetListItems web service. Since this is on the client side, you will need to get the full list of results and then get the distinct values using JavaScript + jQuery.


3

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


3

Try giving the complete path to your site and appending the WSDL parameter: http://sp2010/sites/mysitecollection/_vti_bin/Lists.asmx?WDSL


3

I see this is a bit of an old question, but it is unanswered so I'll offer a solution... I have had issues getting the web service calls to work across domains. The issue for me has always been that the SPServices library should reside on the same domain that you're making the web service call to. Symptomatically, I've generally seen a fairly nondescript ...


3

You need to use the Users and Groups web service. If you call the GetUserCollectionFromWeb() method, it will return an XML node containing all the users on the site. You can then look up your specific user using the ID returned in your User node - in the case of the example - 43. The web service will return a collection of User nodes which have an ID ...


3

You should be able to get all of the versions of an item by calling the Versions Web Service with SPServices.


3

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


3

You can call the User Profile Service with each account returned by search. Each Web Service focuses on different tasks and subsets of data and many times you must combine them to build applications. Also consider using my SPServices jQuery library to make things easier. http://SPServices.codeplex.com


3

First off, you can use $().SPServices.SPGetQueryString rather than rolling your own Query String parser. Secondly, you should be able to just set the simple select and not worry about the hidden complex select. The $().SPServices.SPComplexToSimpleDropdown function takes care of updating the complex select under the covers. Finally, you shouldn't need any ...



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