Tag Info

Hot answers tagged

6

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


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


3

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


3

Since you mentioned SPServices, below is demonstrated how to query list item by file name using GetListItems operation: function fileExists(webUrl,listName,fileName,result) { $().SPServices({ operation: "GetListItems", webURL: webUrl, listName: listName, CAMLQuery: "<Query><Where><Eq><FieldRef ...


2

This is how I do it typically: var leave = $(this).attr("ows_Leave_x0020_Type").split(";#")[1]; Meaning for this z:row, get the leave type attribute, split the string on ;# and give me the second item in the array it creates as arrays are zero indexed to give you AL or [0] to get you the index/ID value of the item.


2

i know the answer has been accepted, but to do this through code: add <SharePoint:SPGridView ID=”oGrid” runat=”server” AutoGenerateColumns=”true” > </SharePoint:SPGridView> a ebook on spgridview: ...


2

Yes, you can create Visual Web Parts in Visual Studio for SharePoint Look Create Visual Web Parts in SharePoint 2010 You can use ASP.NET Controls in your Visual Web Part, you can drop this Visual Web Part after deploying your solution to any SharePoint Page (Publishing Page, Web Part Page etc.) For showing list items you can either use GridView ASP.NET ...


2

Keep in mind that you're working client side here, so things are less "controls" at that point and more "collections of HTML elements and some script". I can't tell for certain what operation you're using in your SPServices call, but I assume it's GetListItems from the rest of your code. When you make that call, SPServices uses AJAX to query the server for ...


2

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


2

Without knowing more information about your code, it's hard to make a suggestion. But what I would do is create a query to ListData.svc with the following filter: var queryString = "?$filter=Name eq '" + provisdionalName + "'"; var listUrl = "_vti_bin/Listdata.svc/YourList/$count" + queryString; $.ajax({ type: "GET", url: ...


1

2013 SP.Web.getUserById() http://msdn.microsoft.com/en-us/library/office/jj247179(v=office.15).aspx or spservices GetUserProfileByGuid and GetUserProfileByIndex should work http://spservices.codeplex.com/wikipage?title=UserProfileService and another solution http://spservices.codeplex.com/discussions/262196 $.ajax({ url: ...


1

The following example demonstrates how to add error handling for CopyIntoItems operation in SPServices: completefunc: function(xData, Status) { var errorCode = $(xData.responseXML).find('CopyResult').attr('ErrorCode'); if (errorCode == "Unknown") { var errorMessage = $(xData.responseXML).find('CopyResult').attr('ErrorMessage'); ...


1

You could use SP.File.checkOutType property to determine whether document is checked out of a document library REST $.ajax({url: "/_api/web/getFileByServerRelativeUrl('" + docUrl + "')/checkOutType", headers: { "Accept": "application/json; odata=verbose" }, success: function(data) { if(data.d.CheckOutType == 0) { ...


1

For some reason, although most people are able to use $(xData.responseXML).find("FieldInformation").each(function() I was having issues with it, so I used "responseText" in place of "responseXML". A user in the comments section helped me solve the issue privately. update: I found that this issue was simply a bug in jquery 1.9.1.. ...


1

You can have a look at my codeplex project SharePoint 2010 Autocomplete Lookup Field which is an custom lookup field that uses combination of JQuery and REST and it also supports multiple values. Additional filters can be specified using REST Query. There is 2013 version also available on codeplex.


1

So, that option number seven you pointed out above is jQuery Tokeninput. http://loopj.com/jquery-tokeninput/ I think you could wire that up fairly easily to work with your SharePoint list. Right now, when it needs to look up an item, it makes a request to a specified URL. I would just modify the source so that instead of calling an external URL to get ...


1

One way to implement a lookup on a large list is to stuff your list data into a text file containing JSON and upload the file to SharePoint. Then, do your lookup to the JSON file to achieve the autocomplete. This is one way around the large list (and lookup) difficulties of SharePoint. Although it does add some overhead for updating the data and it's not as ...


1

You're mixing two APIs here. The first section of your code is using CSOM and the middle section is more like what you would do with SPServices to process results from a SOAP call. You should choose which access method you want to use and not mix the two. This is why your script is failing, though you don't say what effect you see when it runs. DVWPs are ...


1

When setting person/group fields with jQuery and SPServices, I've used account (domain\username) and email address without any issues in NewForms. Let me see if I have an example of using it in an UpdateListItems function. If you are going to do it via web services, you need to pass in the user ID value. So you'd do something like this if you need to ...


1

After digging deeper, it appears that SPServices is returning the value, and it appears jQuery is the actual problem of not updating the value retrieved from SharePoint when using rich text. I tried the following which did not originally work: $("<%=txtProgressNotes.ClientID%>").val('Will not work'); ...


1

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


1

Here's the solution I went with: I first built my dropdown on the form itself (still using the built in web form): <tr> <td style="width:190px;border-left:thin black solid;border-top:thin black solid;" valign="top" class="ms-formlabel"> <H3 class="ms-standardheader"> <nobr>Vehicle Assigned / Used</nobr> ...


1

How about: <Where> <Eq> <FieldRef Name='_Level' /> <Value Type='Integer'>255</Value> </Eq> </Where> Looking at a Pages library where I created a new item sitting at version .1, I see the _Level field at 255 and for checked in major versions it's 1. Or maybe ...


1

In SharePoint you can build autocomplete in various ways. Using SP2013 you can build an autocomplete field using Using the SPClientAutoFillcontrol Using Search Use JSLink to manipulate your new and edit form Use Jquery autocomplete For SP2010 you can for instance use Custom Picker dialog Use Jquery autocomplete


1

The problem isn't with SPServices. The problem is we are trying to use reserved characters. Try using the following functions, escapeColumnValue("Yourvalue") // Escape column values function escapeColumnValue(s) { return s.replace(/&(?![a-zA-Z]{1,8};)/g, "&"); //(/&/g,'&'); } OR xmlencode("yourvalue"); Source Hope this helps ...


1

Its hard to tell what the issue is... Have you looked around on the SPServices codeplex forums? The thing with SPGetCurrentUser is that it scrapes a HTML page (/_layouts/userdisp.aspx?Force=True) for the information (documentation here)... So if you go to that page for the given user(s) and you don't see the information you expect to retrieve, then the ...


1

We've discussed this in the SPServices discussions. It's not a good idea to delete users from a Site Collection even if you could. From my reply on the thread above: Think about the instances where the user created or modified content. All of a sudden that content will have no Author or Editor. In some instances, you will even get the dreaded "An ...


1

Piecing together 2 articles (MSDN and 2), it looks as if your QueryText section should be like this: <QueryText language=xml:lang type='MSSQLFT'> SELECT Title,shortdescription,description,Rank, FROM portal..scope() WHERE CONTAINS ('"test*"') AND ( ("SCOPE" = 'TestScope') ) ORDER BY "Rank" DESC </QueryText> I had looked into this before, ...


1

On the reference page for the QueryText element, it says that if the type is set to "string", then you are using a keyword query. When using the Keyword Query Syntax, you can specify property restrictions, and to set a property restriction for PDF files, you use "filetype:pdf". I believe you would add that right in with the free text query for the word you ...


1

I read that limitation differently - in that you can only have up to 96 different columns in your list which are defined as Lookup columns. From the way you have described your list it sounds as if you are only using one Lookup column and it is a single value column - so this is actually one of the possible 96.



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