API for interacting with SharePoint from .NET, Silverlight, and JavaScript.

learn more… | top users | synonyms (3)

0
votes
1answer
90 views

BCS Managed Client Code Get all method instances

When using the class Microsoft.BusinessData.MetadataModel.Entity entity; does anyone know how to get all the External Content type operation method instances so i can dynamically pass the value to ...
0
votes
1answer
2k views

CSOM Item Level Security “Cannot add a role assignment with empty role definition binding collection.”

I am trying to create an app that will set item level security for certain items in a library. However, I am getting the error mentioned above after these lines: item.RoleAssignments.Add( grp, ...
0
votes
1answer
79 views

How to validate if a SharePoint group already has permission on the site using Client Object Model?

I'd like to check if a certain group already has permission on the site using the client object model. I couldn't find any good example for that.
1
vote
2answers
704 views

Copy all items in a folder to another location

How do I copy all items from one folder(include sub folders and all files) to another folder or location? I have to copy all items to one folder another folder by using C#
0
votes
0answers
67 views

Upload document to sharepoint office 365 - file Type Icon

iam trying to uploading the excel file to office 365 share point using CSOM with C#, i able to uploading the file,but file type icon(EXcel symbol)is not showing in share point site. any one can help ...
1
vote
2answers
835 views

query.set_viewXml retrieving everything

I am writing code for client side object model, and I want to retrieve items with specific title, like this: var context = SP.ClientContext.get_current(); var web = context.get_web(); var lists = ...
1
vote
2answers
2k views

how to get sub folder list and how verify the folder name exist or not using CSOM ,C#

i have to verify the subfolder names if not there in that list how to create dyanamically using CSOM and C#
2
votes
2answers
1k views

Send Email from CSOM

Is it possible to send an Email from an Autohosted Sharepoint 2013 app from CSOM code (C#) with an attachment? I have the following code: EmailProperties properties = new EmailProperties(); ...
4
votes
1answer
367 views

App prison break

Me an my colleges were discussing the possibility of breaking out of the sandbox that a SharePoint-hosted apps provide. As most of you know host webs in SharePoint 2013 are protected by deploying apps ...
1
vote
1answer
1k views

Sharepoint 2013 Content Search vs. Javascript CSOM

I did what this page teaches: http://code.msdn.microsoft.com/SharePoint-2013-Querying-a629b53b It works, but the thing is that I used the same KQL query in a content search webpart and I have ...
0
votes
0answers
300 views

SharePoint 2013 BCS External Data Column

How do I return all entities without using entity.GetFilters() ? I have the following and I can only seem to produce a FilterCollection. I would much rather have just all the enities because i am ...
2
votes
2answers
1k views

How to copy the complete folder structure one location to another location include all files and sub folders

I have folder structure like in Shared documents/East using CSOM and C# Main Folder Folder1 Folder2 File1 File2 I have to copy all folders with files to Shared documents/West ....
3
votes
1answer
260 views

Change SiteLogo via csom in SharePoint 2013

Regarding to this Question link. How can i change the siteLogo to a new one? Is it even possible to do it from a ConsoleApplication via CSOM?
0
votes
0answers
72 views

Best method of downloading a folder of content from multiple versions of SharePoint from .NET

I need to implement some code which, given a specific site URL and folder, will download all files within that folder and any sub-folders. I know I can use the SharePoint Client SDK for that, but one ...
1
vote
2answers
4k views

CSOM move the files one folder another folder

I have to all files from one folder another folder using CSOM and C# Thanks for your replay Huge Wood my code is below var targetSite = new Uri("https://hello.com//teams/Worldwide_Site"); ...
1
vote
1answer
224 views

Proper way to check if Web.Title is available (CSOM)?

We can check if Web.Title is available this way: if (!_clientContext.Web.IsPropertyAvailable("Title")) { _clientContext.Load(_clientContext.Web, w => w.Title); _clientContext.ExecuteQuery() } ...
0
votes
0answers
195 views

401 when authenticating against Sharepoint Online

Good morning. Being very new to SharePoint, I've been trying to write a very basic app to create a new site inside my Sharepoint Online tenancy, but I can't seem to get it authenticated. I'm using the ...
2
votes
1answer
331 views

What is difference between executefunc and executeordelayuntilscriptloaded?

Execute func: SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function () { console.log("Initiating SP.ClientContext") }); ExecuteOrDelayUntilScriptLoaded: ...
0
votes
1answer
334 views

SharePoint 2013 External Content type. Populate secondary fields

I am trying to migrate data to a document library that contains a external content type using the SharePoint 2013 client object model. The external content type is pulling from a sql server 2012 ...
1
vote
1answer
163 views

CSOM in FarmSolution

I am having troubles to get it running and wanted to ask you if you know if it is possible to use CSOM in SP 2013 Farm Solutions? I constantly get an 401 unauthorized exception. Here is how I create ...
1
vote
1answer
236 views

Set 'url title' of a view

How to set the url title of a list view programmatically (preferrably CSOM/JSOM) so we could for example create a view whose View Name is "My View" and its web address ends with "/MyView.aspx"
3
votes
3answers
424 views

List version limits client-side

Versioning can be defined the same way in UI in SP2013 and O365: How can we programmatically set these limits in SP2013 without server-side code? Server-side we would have SPList.MajorVersionLimit ...
4
votes
2answers
2k views

SharePoint 2013 get user groups by CSOM

I wrote some code to get the current user groups by CSOM. function getCurrentUser() { this.clientContext = new SP.ClientContext.get_current(); this.oWeb = clientContext.get_web(); ...
1
vote
2answers
349 views

Why does my console output contain html tags for some field values?

I created a custom list which contains different field values e.g. Text Choice Note Currency Peoplepicker Using the following code I print the field values to console: List mealList = ...
2
votes
1answer
484 views

Get Master Page Gallery via CSOM

How to get master page gallery via CSOM so that we would support language packs / we cannot use Lists.GetByTitle("Master Page Gallery"). So how to get list "_catalogs/masterpage"?
0
votes
1answer
54 views

How do I integration test an SharePoint Online App?

It is my understanding that if I want to do integration testing of Apps for SPO I first and foremost need a tenant to do the testing on. The problem is, how do I run the tests? Ideally I want to use a ...
1
vote
1answer
2k views

breakRoleInheritance and RemoveRole CSOM

I need to breakRoleInheritance on the items of a SharePoint2013 list. I need to remove all the current roles and add only the Owner and the Current user. How can I do it by client side? Thanks, Nk
4
votes
1answer
759 views

Get webpart's Zone Id via CSOM

How to get Web Part Zone Id via CSOM? WebPart has property ZoneIndex but no ZoneId while WebPartDefinition has method MoveWebPartTo(string zoneID, int zoneIndex) but lacks methods to retrieve the ...
1
vote
0answers
70 views

How to convert TimeZoneInformation into TimeZoneInfo

I need get TimeZoneInfo object that represent timezone on SharePoint Server. In client object model I found object Web.RegionalSettings.TimeZone (Class TimeZoneInformation). How I can convert ...
9
votes
2answers
3k views

SharePoint 2013 CSOM: Is it better to pass a Context object around or a Url?

In SharePoint 2013 CSOM is it better to pass a Context object around, or a Url to open a context? Which would be the best example: (Please consider there may be a lot of methods preforming tasks) ...
1
vote
1answer
163 views

Reindex search results (Content Search Web Part, 2013)

I will just leave this here, since it helped us a lot: We have a Content Search Web part with custom Display Templates with link to edit item. After user edit item, we want to refresh the search ...
1
vote
1answer
167 views

Checkout for another user using CSOM?

Can we checkout page to another user via CSOM? Or, first checkout the page and then change to whom it is checked out to?
1
vote
2answers
1k views

How to get title and url using allproperties

How can I get title and url using allproperties? I can get custom proeprty but do not know how to get title and url. I am not able to know as why I get the alert twice in the following code, ...
1
vote
0answers
689 views

Content Search webpart with sort/query using CSOM

How can we add a Content By Search webpart using CSOM when we want to use a custom query (in SP2013)? Would there be an easy way? For example, could we just Import the web part Set ...
1
vote
2answers
2k views

Add List Item with managed metadata field through JSOM

I have a simple scenario, where I've a list with some custom content types. Among other fields, i have a managed metadata field. I want to add a new item in the list through JSOM and this is where I ...
0
votes
3answers
829 views

executeQueryAsync in for loop

Lets say i have a function that has a for loop in it. I need to loop it becouse i have an array that i need to get items dynamically from: newsArray[i].Group. In the function Success , i will be ...
0
votes
0answers
672 views

SharePoint2013 search exception using CSOM

I have created Bing result source and have attached to SharePoint search. When I go to the search site and perform search it's returning results, but when I tried to access the results using csom it's ...
0
votes
1answer
84 views

Unable to trigger workflow

A sharepoint info path form calls this ASMX web service. The webservice inserts items into a sharepoint list like so... item["Area"] = Area; ...
0
votes
2answers
1k views

How to insert record to sharepoint multi choice field via CSOM

I am trying to insert a Multichoice (checkbox) field to sharepoint via the SP namespace in javascript. Updatnig single choice is simple. For Multichoice I have tried: var itemCreateInfo = new ...
0
votes
2answers
348 views

Retrieve People or Group Field to string instead of Object

Iam retrieving an item from my list with jsom in a script editor. i retrieve a field wich is the type of: user or group field. I want to display the group name i retrieve. I tryied to parse to json, ...
2
votes
1answer
611 views

Get file ID after upload using JSOM

I use JSOM to upload document in library. I use this JS: var file; var fileCreateInfo; function CreateFile() { // Ensure the HTML5 FileReader API is supported if (window.FileReader) { ...
0
votes
0answers
187 views

Office 365 Client Object Model, Unauthorized Exception

I have been trying to read the contents of a list from a Office 365 site. I used this link as reference. Code: var clientContext = new ClientContext(siteUrl); SecureString passWord = new ...
0
votes
3answers
235 views

Questions and Answer App

I am currently designing a questions and answers app for office 365. Users can submit questions and other users can answer (very similar to stack exchange). This is for an intranet. I am currently ...
1
vote
2answers
226 views

how can we get the current url via JSOM on masterpage?

We have masterpage which is set programatically to all sites on all site collections. On masterpage we want to redirect user based on a value to a page in layouts folder. I have read that the ...
3
votes
1answer
499 views

Get distinct values via mechanism used when clicking “Show Filter Choices” on a Sharepoint list using Javascript

As many other people on this site seem to need, I'd like to get an array (or equivalent) of the distinct values in a field for a list. The canonical way of doing this is to retrieve the entire field ...
0
votes
2answers
880 views

Add item to list using button

I try to create button that will be add item to the list. Unfortunately I do somethings wrong. My programming skill's are at beginner level. I have list "List" with only one field Title (for test) - ...
0
votes
1answer
2k views

How to Get User Active Directory Groups in Sharepoint Online

I can't find any documentation or a way to find if a user belongs to an AD group with Javascript neither with the REST API or with the client model JSOM. I have a page in a Sharepoint site and I want ...
3
votes
1answer
91 views

Access Selected Items from List View

The following returns selected items correctly from standard list and document library types. var context = SP.ClientContext.get_current(); var items = ...
1
vote
1answer
104 views

SharePoint 2013 navigation permissions

I have setup a metadata navigation. But now i only want sites to be visible for users that are members on this sites. Security triming does not works with metadata navigation, i was thinking some ...
1
vote
1answer
77 views

Remote event receiver setting LastModifiedBy to “SharePoint Program”

I have a remote event receiver, on a list, that fires every time an item is updated, and it works fine. However the "Last modified by"-field on the item is set to "SharePoint program". I have tried ...