Tag Info

New answers tagged

1

You can use this URL : http://rootsite/_api/Web/webs?$expand=Lists/RootFolder&$select=Lists/RootFolder/ServerRelativeURL. This will return the subwebs along with the lists property expanded for each subweb. The Lists property will return all the lists and libraries associated with the subsite.


1

Try this one: /_api/Web/Lists?$select=Title,RootFolder/ServerRelativeUrl&$expand=RootFolder Then iterate all results and select list.RootFolder.ServerRelativeUrl.


0

I've written a JavaScript module in an attempt to fix this shortcomming in JSOM: http://summarylinkstore.codeplex.com With that module, you would be able to iterate the links with the following code: var fieldValueXml = listItem.get_item('SummaryLinks'); var fieldValueObject = new oPB.SummaryLinkStore(fieldValueXml); var summaryLinks = ...


0

Turns out I was misreading my debugger and should have been troubleshooting a nested function that had a typo in it. Such a dumb problem. Thank you for the suggestions regardless.


0

May be your script is getting executed before the sp.js loaded completely(including its dependencies). So enclose your code in 'SP.SOD.executeFunc' like SP.SOD.executeFunc('sp.js','SP.ClientContext',function(){ // your code here }); if you are writing this script to get only the site title and url then you can use _spPageContextInfo.webTitle and ...


0

I got a similar issue when I tried to upload a document to One Drive using a SharePoint Hosted app, I used REST to upload document, I got Forbidden error even if my App has full permissions to tenant. I used a Developer site to implement the app. Later I came to know that we cannot do cross site operations with an app deployed at a site collection level with ...


0

Hope this may help you <html> <head> <script src="/sites/ABCD/SiteAssets/jquery.min.js" type="text/javascript"></script> <script src="/sites/ABCD/SiteAssets/jquery.SPServices-0.7.2.min.js" type="text/javascript"></script> <script type="text/javascript" ...


1

Some how I figured out the way of using deferred and promises in correct manner. Following code runs perfectly as required. function upload() { // Define the folder path for this example. var serverRelativeUrlToFolder = 'SiteAssets'; // Get test values from the file input and text input page controls. var fileInput = jQuery('#getFile'); ...


0

Define a click function on the save button and do something like this $(".btn").click(function(){ //execute operations for saving data alert("Changes Saved"); //redirect the user }); The alert function halts execution of the code until it's dismissed.


0

Write the below code in a script editor webpart: <script type="text/javascript"> function PostSaveAction(){ alert("Your item is created!!"); window.location = "http://www.yoururl.com"; return true; } </script> This function is called after an item is created.


0

I ran into this problem also. I suspected what was happening was that while the code is delaying for 'SP.js' to load, 'clientTemplates.js' is running full steam ahead and calls RenderListView() before the code can execute RegisterTemplateOverrides(). My answer to this was to leverage @Aveenav's answer to overriding the BaseViewId on Using Different ...


0

I usually use REST for this sort of thing. This example is looking for a list called 'FooterLinks' and populating them into a div with the jquery each method. $.ajax({ url: "/_api/web/lists/GetByTitle('FooterLinks')/items", type: "GET", headers: { "accept": "application/json;odata=verbose", }, success: function (data) { ...


4

Use _spPageContextInfo.siteAbsoluteUrl for getting the site collection url. For more info, refer : http://blah.winsmarts.com/2013-2-_sppagecontextinfo_is_your_new_best_friend.aspx


0

Remove the semi-colon from your jquery definition tag. It should look something like: <script src="//code.jquery.com/jquery-1.11.3.min.js"></script> Text between tags that should reference external scripts will mess things up.


0

You could display your results using datatables. Although not looking exactly like Sharepoint, it should give you the features you are looking for - filtering, sorting, paging. DataTables Table plug-in for jQuery


0

You can use email event receivers for this. Check a similar question here : How to enable an Event Handler to intercept upload from email in document library


0

I think you have the client context that starts with dev and you are in test: var clientContext = new SP.ClientContext("http://dev");


1

sigh .... Turns out I should have removed the .get_url() from my if condition and it should have been: if(oListItem.get_item("Image"))


1

I've been using the DataTables plugin for jQuery Javascript library to build lists with full sorting, filtering, etc. functionality using the SharePoint API. The library is pretty easy to use and there are additional extensions and plugins. As an example, here's a simple initialization of a DataTable with a filter added to the 2nd column that I built a few ...


3

With the peace of the mp you provided what I can see is that it is 99% equal to oslo.master. The main difference is that you removed all security trimmed controls, which should not affect in this case. I cannot tell what is going on, I don't know how you deploy the masterpage, so if you have a composed look, difficult to say. So if you want to reset the ...


1

Try the below code. Just added <View></View> to your query. function createListItem(decision, id, likes) { var siteUrl = '/'; var countLikes = likes; var clientContext = new SP.ClientContext(siteUrl); var oList = clientContext.get_web().get_lists().getByTitle('PostLikes'); var camlQuery = new SP.CamlQuery(); ...


0

Try using the currentContext by var ctx = SP.ClientContext.get_current()


0

There is a way to achieve this by posting to the people picker REST api. So maybe you can build your own people picker to do the manipulation instead of relying on the OOB people picker. Note: Replace <termtosearch> with the the appropriate term you want to search the result set with. $.ajax( { ...


4

Have you tried to set keywordQuery.set_trimDuplicates(false); (MSDN) because maybe some rows / items are incorrectly treated as duplicates by search?


2

Answering your updated question, as to why you need an asterisk for it to work: Because 0x010066FA3DE3E334C841B418C82CC475A227 is an ID of a site level content type. When you add a site content type to a list, SharePoint makes a local copy on the list itself. From this article on MSDN (emphasis mine): In addition, SharePoint Foundation makes a local ...


2

I would suggest to use a simple IDE to develop your code. This IDE will help you by finding simple errors. A free example for a IDE is Visual Studio Code but there are loads of IDE's for you to choose. Here's the output if I paste your code: After knowing the simple errors fixing is not the problem - at least the ones caused by bad syntax.


0

The datasheet view was renamed to quick edit in SP2013, removing the ActiveX dependencies and migrating the implementation to html / js. There is almost no documentation about what you are trying to achieve, but I would give a try to spjeff implementation, who overrides the template implementation: ...


0

http://www.viewmaster365.com/#/Create/SearchFilter This kinda weird looking code in a Calculated Column set to datatype is Number will attach a KeyUp event to a DOM element above the search box, that way catching each keyup event. If you attach it to each TR (TableRow leave out the 3 parentNodes), it should work in a Datasheet View as well. =" <img ...


1

Option 1: Search Display Template If you are using SP2013 and want to display the list attachments in search results, try this article: Solution to displaying attachments for a list item in a search result There’s an undocumented managed property named LinkOfficeChild which gives us exactly what we need. If you split the value on line break you will ...


0

Try wrapping your JavaScript inside the SharePoint 'ready' function: <script> function _spBodyOnLoad() { var pickerPeople = SPClientPeoplePicker.SPClientPeoplePickerDict['<ID of my people picker>'].GetAllUserInfo(); if (pickerPeople.length > 0) { alert("User: " + pickerPeople[0].DisplayText); } } </script> Not sure ...


0

try to enclose your code in _spBodyOnLoadFunctions.push(function(){ // code to capture people picker value }); Or use JSLink to add PostRender callback ovverideCtx.OnPostRender = function(ctx){ //code here };


0

If you are trying to access sharepoint data from outside of sharepoint, (ie in a .net application / android app etc), then you need to consume the client object model or the web service exposed by sharepoint. This Discussion has a pretty detailed explanation towards using authentication.asmx to get a token that can be used for intearaction with sharepoint. ...


0

If you are trying to access sharepoint data from outside of sharepoint, (ie in a .net application / android app etc), then you need to consume the client object model or the web service exposed by sharepoint. This Discussion has a pretty detailed explanation towards using authentication.asmx to get a token that can be used for intearaction with ...


0

You can use rest api to get just the name of all the attachments. You need to paste the function in the script tag in your page, and put the html snippet anywhere you wish to show your attachments. Function to get attachments, this goes into your script tag : var attachments = function(url, name, ID) { alert('Ji') $.ajax({ method: 'GET', ...


0

Using CSS or CSR or Calculated Columns; I answered this in detail 2 weeks ago: How to Truncate a multiline column in a SharePoint List 2013


3

Only through AZURE OR an APP or ADD-IN can you access content in SP using the REST api (and ADAL) Most links in the other answer are about making REST calls within the same domain. I have a similar open question: Is Visual Studio required to built a Front End to write (REST) data into a SharePoint Online list


0

You can do this by multiple ways i) JSOM ii) CSOM iii) REST API You can do farther research. https://msdn.microsoft.com/en-us/library/ff798473.aspx https://msdn.microsoft.com/en-us/library/office/fp179912.aspx Go through Links for REST API https://msdn.microsoft.com/en-us/library/office/jj860569.aspx ...


0

You can do this by multiple ways i) JSOM ii) REST API Basically i choose REST API to remotely access SharePoint Office2013 Online. Go through Links https://msdn.microsoft.com/en-us/library/office/jj860569.aspx https://msdn.microsoft.com/en-us/library/office/fp142380.aspx ...


0

What is the solution to the get the value of lookup field var table = $('#example').DataTable({ "filter": true, "bDestroy": true, "bProcessing": true, "aaData": data.d.results, "aoColumns": [ { "mData": "ID" }, { "mData": "Title" },{ "mData": "lookupfield" },]


1

You cannot use executeQueryAsync in a loop, the loop execution does not wait for the execute Query call completion(it is async). So try to load all items once and call 'executeQueryAsync' outside of the loop and also we should not create the clientContext and list objects inside the loop(if so, only the last object inside the loop will have correct context ...


0

I had the same error message in a html without SharePoint Server rendering. For me I mixed up the load sequence of the sp.runtiem.js and sp.js. You have to load the sp.runtime.js before the sp.js <head> ... <script src="//ajax.aspnetcdn.com/ajax/4.0/1/MicrosoftAjax.js"></script> <script ...


2

Basically you need to iterate through the whole list field collection, do checks (if the field is read only, visible etc.) and then assign the value. Replace this (instead of setting one particular column): oListItem.set_item('Title', objListItem.get_item('Title')); with this (iterating through all the columns in a list): this.listFields = ...


0

<script type="text/javascript" src="filelink/jquery-1.6.1.min.js"></script> <script type="text/javascript" src="filelink/jquery.SPServices-0.6.2.min.js"></script> <script language="javascript" type="text/javascript"> var getListCalender = document.getElementById('CalenderListDrop').value; var spHostUrl = ...


1

May be you should try declaring your ListItem variable globally, what I can see from your code is that it is local to Submit function. Refer below code change. // Declared globally which can be accessible in other functions as well var ListItem = null; function Sumbit() { $('#submitBtn').click(function () { var ctx = new ...


1

I think you can use the function "RefreshLoad()" on the ListItem before using ListItem.get_id(); . Don't forget to use an executequery on your context before re-using it.


0

Added now the ENGLISH Version of my 10 Step guide. More Info in the blog post!


7

John is more or less right, but you need to use SP.KeyValue afaik: 'properties': { '__metadata': { 'type': 'SP.Utilities.EmailProperties' }, 'From': from, 'To': { 'results': [to] }, 'Body': body, 'Subject': subject, "AdditionalHeaders": {"__metadata": ...


4

Looking at the example and your error message, I wonder if AdditionalHeaders needs results (similar to To:) data: JSON.stringify({ 'properties': { '__metadata': { 'type': 'SP.Utilities.EmailProperties' }, 'From': from, 'To': { 'results': [to] }, 'Body': message, 'Subject': subject, 'AdditionalHeaders': { ...


0

Not enough Reputation to add a comment, but DacrioS has cracked it. I have an on-premises install of Sharepoint 2013 and could not get attachments to show up when using _api/web REST interface. Until I read this comment: "Try adding Attachments to the select." Let me be clear: This Does Not Work ...


0

You can use the ADAL library to Authenticate with AZURE https://msdn.microsoft.com/en-us/library/azure/dn151135.aspx https://github.com/AzureAD/azure-activedirectory-library-for-js http://www.cloudidentity.com/blog/2014/10/28/adal-javascript-and-angularjs-deep-dive/



Top 50 recent answers are included