New answers tagged

0

Based on your comment response, you'd do it like: var itemProperties = { '__metadata': { "type": "SP.List" }, "Title": $("#FirstName").val(); };


0

RefreshPageToEx is more powerful function and if table class is "ms-bottompaging" then no full refresh happens. if the class is reptetive or not being used then full postback happens. if try it and let me know if you still face the problem. its bit late post but will update complete plugin sooner


2

In SharePoint Hosted App, You can use jQuery.ajax directly. There is no need to use SP.RequestExecutor.js. SP.RequestExecutor.js does not have any option like beforeSend:fn. In SharePoint Hosted App, execute jQuery.ajax request like following: jQuery.ajax({ url: _spPageContextInfo.siteAbsoluteUrl + url, type: "GET", headers: { "accept": ...


0

I can think of a couple of Options: 1: Get all fields in item from rest and filter out SharePoint Default fields. 2: create a new Content type which contains all desired fields. _api/web/lists/getbytitle('Samples')/contenttypes _api/web/lists/getbytitle('Samples')/contenttypes('"+ contentType +"')/fields first one gets all Content types. Note there are ...


0

qString= null; $( document ).ready(function() { var qString = getdetails(); if(qString != null) { $.ajax({ url: _spPageContextInfo.siteAbsoluteUrl + "/_api/web/lists/getbyTitle('My list')/items/?$select=Title,Name,Age,DOB,Indian&$filter=ID eq "+qString, method: "GET", ...


2

Your code fails because the Function declaration is wrong: You do: function getdetails( {dosomething} ) But the correct way of declaring a function is: function getdetails() {dosomething} BUT, More potential errors: Your code tries to extract the ID value when it is the first QueryString parameter in the URL So it fails: When ID is not immediatly ...


0

var result; $( document ).ready(function() { getdetails(); var qString = result; }); function getdetails() { result = window.location.href.split("?ID=")[1]; return result; }


0

Please check the getdetails function.Code is inside () function getdetails(){ var result = window.location.href.split("?ID=")[1]; return result;};


0

Please try below mentioned code. var result; $( document ).ready(function() { getdetails(); var qString = result; }); function getdetails() { result = window.location.href.split("?ID=")[1]; }


0

Found my Problem: Useing type instead of Type which gave weird errors which made me believe that filtering useing this method of caml wasn't possible, because when it didn't gave errors it just ignored the filters. There should really be better error message descriptions (Especially since I get german one's) var caml = ...


2

I have to say, I'm not a big fan of the do this for me questions, but this is a a good start to converting your JSOM to REST/AJAX. I haven't tested this, but this should be a good starting point for you. var qString = window.location.href.split("?ID=")[1]; var listName = "My list"; var collListItem; $.ajax({ url: ...


0

Thanks for everybody's responses. Close to jpussacq's question I was able to get it working by using the lists hidden attribute by using the set_hidden(true) in the following way: //JSOM example ExecuteOrDelayUntilScriptLoaded(hideListItem, "sp.js"); function hideListItem(){ var ctx = new SP.ClientContext().get_current(); var thisList = ...


1

Try this var list = ctx.Web.Lists.GetByTitle(listTitle); list.Hidden = true; list.Update(); ctx.ExecuteQuery(); Source: Hide document library using CSOM Note that in the source they use BreakRoleInheritance to prevent users from accessing the list.


2

I only browsed your code You have to look closely at WHERE inside the then resolves your code runs, ie. if (errCnt>0) will run before attachments are found. Also try to merge your code, you have 2 branches that almost do the similar, merge them into one... your code will become smaller.. your code will be easier to debug


0

query ="?$select=ID,Title" url: _spPageContextInfo.webAbsoluteUrl+ "/_api/web/lists/getbytitle('" + listname + "')/items" + query, ID and Title are the column names of the SharePoint list specified(list name). _spPageContextInfo.webAbsoluteUrl gives the url of SharePoint. In success function you will get the ID,Title etc success: function (data) { ...


1

Here you can use any of the query but before that you must be clear with your own requirement. If you want to get data with specific parameter (like you want to filter your data) then you can use the following code Here i am just updating your code to pass the fieldname and fieldvalue. ( here i am assuming your list contain only one record, in case of ...


0

You can build your query in several ways and as per your need. But before coping code you have to understand your requirement as well rest api in 2013. Have a look in my article to get started. CRUD Operation to List Using SharePoint 2013 Rest API



Top 50 recent answers are included