Hot answers tagged

5

MONTH( [MyDate] ) will return 1 for January, then use the SharePoint version of the switch/case statement: =CHOOSE( MONTH([MyDate]) , 30 , 60 , 60 , 60 , 60 , 60 , 60 , 60 , 60 , 60 , 60 , 60 ) remember: if you are going to work with Dates in JavaScript then January = 0 and December = 11 All SharePoint functions: www.viewmaster365.com/functions ...


3

Creating items in lists is actually an asynchronous process. When you commit your changes, the item is written, but there's no way to guarantee when the item will be written. I'm sure of this because of the way I had to write the SPRedirectWithID function. As you might expect, it's generally very quickly after the submit, but it depends on server load, etc.


3

Search is a pretty resource intensive component of a SharePoint farm. If the system has a lot of content to process/crawl and this impacting your daily operations then you should check that continuous crawling is disabled and then schedule your crawling for off hours. It sounds a bit like you may not have enough RAM to begin with. 12 GB seems like a fair ...


3

You can go through the Url : https://technet.microsoft.com/en-us/library/ee704549.aspx or you can apply this: $farm = Get-SPFarm $farm.TimerService.Instances | foreach { $_.Stop(); $_.Start(); }


3

Once you have changed the credentials, just restart the timer service. This will reset the credentials and apply the new ones. Restating the service will not create any problems.


3

Try this instead. I've also fixed some errors in your code. _spBodyOnLoadFunctionNames.push("Init"); function Init(){ alert("Before SPCascade"); $().SPServices.SPCascadeDropdowns({ relationshipList: "List 1", relationshipListParentColumn: "List 2", relationshipListChildColumn: "Title", parentColumn: "List 2", ...


3

Eric Alexander is right on both of his points, but I don't think that's why you're getting the error that SPServices is undefined. Is jQuery getting loaded somewhere else on the page? I have seen this happen when there's another link to load jQuery somewhere lower on the page than the link to SPServices. Then jQuery re-loads itself and loses the ...


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.


3

You can use this to break out the string explicitly: var emails = $(this).attr("ows_UsersList").split(";#").filter(function(e){ return !parseInt(e)}) var emailsjoined = emails.join(";"); emailsjoined is the semicolon delimited string of email addresses.


3

operation: "GetListItems", async: false, listName: "Marketing Requests", viewName: "54E61A50-B5A9-4D59-91B9-EA9D280B8C24", CAMLRowLimit: 5000, CAMLQuery: "<Query><Where><Eq><FieldRef Name='Assign_x0020_To'/><Value Type='User' >" + selectedDesignerOpenProjs + "</Value></Eq></Where></Query>", completefunc: ...


2

If the list is located on the same site on which the JavaScript is running, you don't need to use SPServices and jQuery, you can use the built-in JavaScript client object model like so: <table id="Announcements"></table> <script> ExecuteOrDelayUntilScriptLoaded(getMyListData,"SP.JS"); function getMyListData(){ var listName = "...


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


2

In a document library, you'd want to use the ows_FileRef field to pull the URL of the file. This will get you a value like, /managedpath/site/library/filename.jpg, which is what I think you're after here.


2

The function you are asking about is SPFilterNode, and it's part of SPServices. The reason the function even exists is to help with cross-browser compatibility. Browsers other than IE won't work with the z:row namespace (or any other with a colon) properly. By providing SPFilterNode - based on Steve's excellent work - I'm able to give you cross-browser ...


2

You need to delay for sp.js I guess for using $().SPServices. In SharePoint 2010 ExecuteOrDelayUntilScriptLoaded(functionTobeCalledNext, "sp.js"); In SharePoint 2013 SP.SOD.executeFunc('sp.js', function () { // code goes here }); Ignore jQuery document ready. It doesn't ensure that sp.js is loaded.


2

Yes, SPServices wraps the Lists web service: https://spservices.codeplex.com/wikipage?title=Lists Which includes AddList: https://msdn.microsoft.com/en-us/library/lists.lists.addlist.aspx Once the list is created, you would use UpdateList to add fields or modify other properties: https://spservices.codeplex.com/wikipage?title=UpdateList&...


2

The best way to list sites a user has access to is do a search for: contentclass:STS_Web If you really really want to implement the slow way then you need to use SPSecurity.RunWithElevatedPrivileges as you'll come across web applications/site collection the current user doesn't have access to


2

Make a GET request to the following URL, It will return all folders /_api/Web/GetFolderByServerRelativeUrl('" + libraryRelativeUrl + "')/Folders?$select=Name,ServerRelativeUrl Using jQuery function getFolders(libraryRelativeUrl) { var queryUrl = "/_api/Web/GetFolderByServerRelativeUrl('" + libraryRelativeUrl + "')/Folders?$select=Name,...


2

Your solution with SPServices is just ok. You should use jQuery to parse data and you could use selectors: var picker = $().SPServices.SPFindPeoplePicker({ peoplePickerDisplayName: whatDisplayName //your picker control field's display name }); var data = picker.row.find("div[id='divEntityData'] div").attr("data"); var xml = $(data);//accepting data by ...


2

You might want to try clearing the configuration cache. The steps for doing this are posted on a few places on the web, here's a link to one: http://blogs.msdn.com/b/jamesway/archive/2011/05/23/sharepoint-2010-clearing-the-configuration-cache.aspx The steps are formatted and it'll take too long to copy and paste and reformat here, but essentially - ...


2

You can use list settings page to find the field internal name and use that in the query. Open list settings and click on the column hyperlink which takes you to the column settings page. Just look for query string Field.


2

var context = SP.ClientContext.get_current(); var selectedItems = SP.ListOperation.Selection.getSelectedItems(context); var fileName = []; for (var i = 0; i < selectedItems.length; i++) { var itemId = selectedItems[i].id; fileName[i] = GetName(itemId); } function GetName(itemId) { var currentList = context.get_web().get_lists()....


1

Your first <And> have three child clauses. That's not permitted. One <And> (or one <Or>) must have exactly two children. You then must nest all clauses so you only have two clauses in any <And> or <Or>. If you run this query from an SPQuery class (i.e. you set your CAML string into mySPQuery.Query property), you must get rid of ...


1

I resolved this issue by function below: completefunc: function (xData, Status) { //alert(xData); // console.log(xData.responseText); var specialCharsDeleted = xData.responseText.replace(/&#11;/g, ''); var xmlDoc = $.parseXML( specialCharsDeleted ); $(xmlDoc).SPFilterNode("z:row").each(...


1

I faced the same issue and the reason was that the FIM services were stopped. Forefront Identity Manager Service & Forefront Identity Manager Synchronization Service. If these services are not running, you won't be able to see the connections that you already configured. Check the services and start them again. Sometimes, FIM Service does not get ...


1

I found the answer myself, the issue is mentioned Here by Marc. I should NOT use $(xData.responseXML).find("[nodeName='z:row']").each(function() instead, have to use $(xData.responseXML).SPFilterNode("z:row").each(function() its because the jQuery version 1.8.2 doesn't support nodeName='z:row' so,we must use SPFilterNode("z:row").each(function) ...


1

Two things I see: You don't have to URL encode your list name, "Team List" is fine. parentColumn and childColumn should be the name of your column on the form, not the internal/static name.


1

You can do this easily with the built in JSOM or REST APIs. Reference this within a content editor: <script> SP.SOD.executeOrDelayUntilScriptLoaded(function() { JSRequest.EnsureSetup(); var itemId = JSRequest.QueryString["ID"]; var listId = SP.PageContextInfo.get_pageListId(); var oCtx = SP.ClientContext....


1

Try using below code, $(document).ready(function() { GetEvents(); }); function GetEvents() { $().SPServices({ debug: true, operation: "GetListItems", async: false, webURL: '/', listName: "ListName", completefunc: function (xData, Status) { $(xData.responseXML).find("[nodeName='z:row']")...


1

Document library does not have any URL column unless you create custom one. I think your requirement is to get the the URL and Title of documents. In document library there is a hidden column named FileRef. It stores document's relative path like /yourSiteUrl/YourLibraryNam/FileName.Extension So your CAMLViewFields should look like following "<...



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