Hot answers tagged

8

Check out this excellent article where the performance of both is tested: Deep Dive – REST and CSOM Comparison I tested a series of pretty common operations in both REST and CSOM: Creating Lists (10) Creating List Items (100 per List, for a total of 1000) Reading List Items by ID Querying for List Items (retrieving 50 per List) Deleting List ...


5

Using rest API, just make a GET request to the following end-point: _api/web/lists/GetByTitle('List Name')/fields?$filter=EntityPropertyName eq 'Choice Field Name'" Example using jQuery $.ajax({ url: "host url"+"_api/web/lists/GetByTitle('List Name')/fields?$filter=EntityPropertyName eq 'Choice Field Name'", type: "GET", headers: {...


4

Fortunately I lately also needed a back button, so I can give you a working solution for it: Just simply add this Code to a Script Editor Web Part or Content Editor Web Part on the Site where u want it. <input type="button" value="back" onclick="window.history.back()" style="color: white; background-color:rgb(196, 196, 196); font: 15px arial, sans-serif; ...


3

I've not provided whole code but you can call cross site connection using JavaScript. Take a reference from below code: var crossSiteContext = new SP.ClientContext("http://url-of-another-siteCollection/"); var crossSiteWeb = crossSiteContext.get_web(); crossSiteContext.load(crossSiteWeb); crossSiteContext.executeQueryAsync(function(){ var ...


2

You can also try this using CSOM: function GetChoiceValues() { var context = new SP.ClientContext.get_current(); var web = context.get_web(); this.taskList = web.get_lists().getByTitle("CMA"); this.fields= this.taskList.get_fields(); var deptChoiceField = context.castTo(this.taskList.get_fields().getByInternalNameOrTitle("Category"),SP.FieldChoice);...


2

Nice question, "Which one is faster CSOM or JSOM for CRUD operation?". But the fact to determine which API to be used for performing a certain operation in SharePoint depends on various factors like type of application, operating system, what kind of operation is to be performed in which system and so on. Based on the MSDN reference, I would say, go with ...


2

Here is the working solution - Step 1 - Edit the Library Page and Add Script Editor Web Part . Step 2 - Paste the Below Code in web part for hiding the required button from ECB Menu Item using the Button ID (Replace ID value after # ). <style type="text/css"> li.ms-core-menu-item #ID_DeleteDocItem, .ms-core-menu-separator hr { display:none; } <...


1

Please see the below example, you can use the "and" operator, to meet multiple conditions, http://{server_name}/_vti_bin/listdata.svc/UserInformationList?$filter=((ContentType eq 'Person') and (substringof(Name,'{query}')))&$orderby=Name Also, shared by Atish, on the following page, it shows you multiple other operators, you can use in your ...


1

For SharePoint Online / Office 365, you can use JSOM to make cross-site collection calls as long as the site collections are all in the same tenant. There are only two scenarios where you can make cross-site collection calls using the JavaScript Object Model in a SharePoint on-premises farm: Both site collections are located in the same web application ...


1

Here this code will work only in case of 2 fields available in your list. It will not work for more or less than 2 fields. Reason: CAML you are formatting is wrong. While building a CAML query it should be always in pair of 2 conditions CmalQuery += "<View><Query><Where><Contains><Or>"; while (e.moveNext()) { ...


1

Remove ' from the query and try like this CmalQuery += "<FieldRef Name="+fieldName+" /><Value Type=Text>" + txtValue + "</Value>"; Maybe this will work.


1

You can use Infopath or Client Side Rendering (JS Link) for hiding the columns of the SharePoint List. for better understanding follow this blog using CSR https://code.msdn.microsoft.com/office/CSR-code-samples-11-Fully-54ebcaa6 To understand CSR well, you can follow this link Client-Side Rendering/JS Link documentation?


1

Nothing wrong with using JavaScript. Almost everything in SharePoint (frontend-wise) is handled with JavaScript anyway. And it would be, by far, the fastest way to do it. SPUtility.js would be a good candidate for a library that brings all the functions you need: https://github.com/kitmenke/sputility


1

You break everything with with this script-tag: <script language="javascript" src="/_layouts/15/sp.js"></script> Remove this one and your script should work just fine


1

How about using window.dynamicTable anywhere you want, that sticks stuff in the global scope It is of course better to create your own scope for variables/functions. window.myScope = window.myScope || {} or to make it MDS save Type.registerNamespace('myScope');


1

Not so trivial after all. I played around a bit and here is what I came up with: Notes first: You will need jQuery (at least on the DispForm.aspx of the Training Calendar list and on the NewForm.aspx of the Registration list) You Registration list needs a lookup column to the Training Calendar list You will have to deactivate Minimal Download Stratgy on ...


1

Even if you could somehow reliably grab the current user's home network, this approach will not work. The embed is going to look for a group on the specified network with the specified ID, and that group does not exist on those other networks. You need to specify the network that hosts the group in your embed code. If the external users are part of the ...



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