Tag Info

New answers tagged

1

As Andrey pointed out there is no SPList.GetItemByUniqueId Method alternative in CSOM API. You could utilize the following extension method to load the list item by GUID in CSOM: static class ListExtensions { /// <summary> /// Load List Item by Guid /// </summary> /// <param name="list"></param> /// <param ...


2

you can use SP.UI.ModalDialog.showWaitScreenWithNoClose If you want to use the 'Waiting' dialog function OpenDialog(targetUrl) { var waitScreen = SP.UI.ModalDialog.showWaitScreenWithNoClose("Loading", "Please wait"); var options = SP.UI.$create_DialogOptions(); options.url = targetUrl; options.autoSize = true; ...


0

Get it work. I replace the CreateFolder function calling by : List DocumentLibrary = clientContext.Web.Lists.GetByTitle(libName); DocumentLibrary.RootFolder.Folders.Add(sharepointFolderName); clientContext.ExecuteQuery(); And delete the two functions. I still curious why it doesn't work, but the ...


1

Referring directly the AssetPortalBrowser.aspx and getting the URL will be very much difficult, rather create an object and open the popup will be easier. Follow the below steps. I am getting the selected selected file in a text box and showing it in a alert. Go to Site Content > Site Assets Create a folder name Scripts Upload jquery-1.11.1.min.js and ...


1

It basically depends on your personal experience with the different technologies, there are many opinions out there with lots of pros and cons that may or may not be relevant to you. I personally very much dislike pure javascript CSOM because of all the context loading and SPServices was a good abstraction for that, but eversince I've used REST in SP2013 I ...


1

Pros A wide range of SharePoint functionality is exposed with the SOAP Web Services, much of which is not available in CSOM Allows anonymous access (assuming it is enabled for the underlying objects) Works cross-site and cross-domain, assuming that the authentication model you are using allows it Simpler syntax than the CSOM. Simply pass the required ...


0

The my idea is get library with ComboBox(controls), with this you can choose where you want save... Example of use: UploadFile("http://mysite.com", combobox.Text, "", "imgscanned.jpg", bmp); Add 2 References in your project: 1.Microsoft.SharePoint.Client.dll 2.Microsoft.SharePoint.Client.Runtime.dll In the code of the your Project: using ...


0

Try this: listItem.update(); context.load(listItem); context.executeQueryAsync(Function.createDelegate(this, AddNewEmployeeSuccess),Function.createDelegate(this, AddNewEmployeeFail));


0

Don't know if it helps, but ClientContext object has a timeout property clientContext.RequestTimeout = Timeout.Infinite; However, you'll be tight to the timeout in the Webserver (IIS). No idea about Cache, but John-o reply seems very good to me.


3

I know in the JavaScript Client Object Model executeQueryAsync is performed using an XmlHttpRequest, the results of which are cached by default. I would assume the managed client object model requests data using the same method 'under the covers' As for how long the cached request is valid, it appears to be dependent upon the user's browser configuration. ...


0

Powershell Script to dump all the folders from one list to another in same or different site collection with metadata . Try it on sample list and test first . function Copy-ItemsToFolder([Microsoft.SharePoint.SPFolder]$folder, $srcList, $destList) { $spQuery = New-Object Microsoft.SharePoint.SPQuery $spQuery.Folder = $folder $sourceSPListItemCollection = ...


0

Currently it's not possible. You could vote for the feature here: http://officespdev.uservoice.com/forums/224641-general/suggestions/6267894-navigateforformspages-support-in-csom If you create the list through CSOM, you could add the following to your list schema: <List NavigateForFormsPages="FALSE" ... >


0

Looking at your error I remember coming across this.. This error used to appear intermittently and not always. This error appears because in SharePoint 2013 the way we have to use JS is changed. I had solved this problem by disabling MDS: How to turn off MDS on all site collections and sites? After running above powersheel to disable the MDS (or do it ...


0

SharePoint client object model (v15) won't work in Azure because it requires Client components and in Azure they aren't installed. Please check the link to see the detail explanation As workaround you can try rewrite to last version (v16) it supports portable versions of libraries. Also you can create own virtual machine and manually install client ...


0

Change your query like : CamlQuery query = new SP.CamlQuery(); query.ViewXml = "@<View><Query><Where><Eq><FieldRef Name='Title' /><ValueType='Text'>{Title Text Here}</Value></Eq></Where></Query></View>"; var itemts= list.GetItems(query);


4

You are missing the <View> tags in your ViewXml (see example here) It should be string qs = String.Format("<View><Query><Where><Eq><FieldRef Name=\"Title\"></FieldRef><Value Type=\"Text\">{0}</Value></Eq></Where></Query></View>", listItemTitle); query.ViewXml = qs; In case of ...


2

The Microsoft.SharePoint.Client.Phone.Runtime.dll contains the ClientRuntimeContext class, which Represents the runtime context for accessing data from remote objects, and invoking methods on remote objects. There is a great write-up here. Essentially: When working with the managed client object model we start with creating a ClientContext class (in ...


0

You could consider the following approaches to determine whether file exists or not. Query based You could construct CAML query to find list item by its Url as demonstrated below: var listTitle = 'Documents'; var fileUrl = '/project/shared documents/orders/order.docx'; var ctx = SP.ClientContext.get_current(); var list = ...


0

Use /_vti_bin/listdata.svc/ListName()?&$expand=Attachments and you'll get back an 'Attachment' object on each result (or an additional node if you're using atom -- you XML weird-o!). The Attachments object contains a results array that contains 0 (if no attachments) or more attachment objects, each with a Name property that has the file name. So if ...


0

So I know this is old, but Community decided we should look at it today... You can enumerate the subwebs and put all the urls as keys in an object, then check if the url was put into the object or not... var myCtx = SP.ClientContext.get_current(); var mySubWebs = myCtx.get_web().getSubwebsForCurrentUser(); myCtx.load(mySubWebs); ...


0

Just try getting the file and use the success/error callback in executeQueryAsync... var myCtx = SP.ClientContext.get_current(); var myFile = myCtx.get_web().getFileByServerRelativeUrl(/<site>/<lib>/<filename w/ extension>); myCtx.load(myFile); myCtx.executeQueryAsync(function() { // success handler, if you made it here, the file ...


0

There are a number of ways to do this, but the typical way remotely distributed apps keep themselves up to date is a call back to a server, each time they initialize, to check if they are using the most up to date versions of specific resource files. If the client detects it is out of date, it can then just ask the user if they want to update, and then your ...


-1

Here are some option: Uncheck overwrite by default http://planet-sharepoint.blogspot.co.uk/2013/10/sharepoint-2010-set-overwrite-existing.html jQuery option http://vegardstromsoy.blogspot.se/2011/05/jquery-to-override-sharepoint-ootb.html


0

I got the solution: oListItem.get_item( 'Created' ) this field contains: "Tue Jun 03 2014 17:01:09 GMT-0300 (Local Standard Time)"


0

did you try this one: static string mainpath = "http://triad102:1001"; static void Main(string[] args) { getSubWebs(mainpath); Console.Read(); } public static void getSubWebs(string path) { try { ClientContext clientContext = new ClientContext( path ); Web oWebsite = ...


0

The name of that column is "Author", "Created by" is just its display name text.


0

Based on comments to the original question, the way in which the scripts are loaded on your page must be preventing SharePoint from initializing all of the standard JavaScript items on the page. Add your custom scripts one by one, and remember that you may need to use jQuery.ready, SP.SOD.ExecuteOrDelayUntilScriptLoaded(<yourscript>, "SP.js") // or ...


1

This error occurs since you are using SharePoint Server 2013 Client Components SDK (ver. 15) or SharePoint Online Client Components SDK (ver. 16) but against SharePoint 2010. Microsoft.SharePoint.Client.Web Url Property was introduced in CSOM ver. 15 How to determine Web Url in SharePoint 2010 The following example demonstrates how to get sub webs url in ...


0

URL is not a property of Microsoft.SharePoint.Client.Web however, ServerRelativeUrl is. http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.web_properties(v=office.14).aspx What are you trying to accomplish?


0

Using get_lookupValue() should work. If you're reading out a multi user it's slightly different too. //Get user field value var peopleVal = item.get_item('People').get_lookupValue(); //Get multi user field value var peopleVals = item.get_item('People'); for(var i = 0; i < peopleVals.length;i++) { var userName = peopleVals[i].get_lookupValue(); ...


2

I believe the simplest and recommended way to achieve this is using either the SharePoint JavaScript Object Model or AJAX. Neither will cause the page to become unresponsive and both should be fast, even with several thousand items. If you are performing just one query, the SharePoint JavaScript Object Model is your best option. The following MSDN article ...


0

You cannot modify user profile properties using CSOM or REST but you can modify these properties using the User Profiles SOAP web service (UserProfileService.asmx) The documentation for ModifyUserPropertyByAccountName has a managed code sample. This blog post has a JavaScript sample which uses the SPServices jQuery plugin.


1

According to http://blogs.msdn.com/b/findnavish/archive/2011/11/16/some-specific-folder-or-files-not-getting-created-in-sharepoint-thickets.aspx and http://social.technet.microsoft.com/Forums/windows/en-US/d6c187ab-3d70-4357-878f-018b9731c161/sharepoint-folder-with-an-underscore-contained-within you shouldn't be able to upload the folders without getting ...


0

Yes, this is problematic. In SP 2007, we had been using the "Lookup site user property" workflow action from Codeplex to lookup the UserName property for various purposes in the workflow. But apparently the UserName property for SharePoint 2010 no longer reliably returns a username. For some users this is now empty. But the Name property never seems to be ...


1

You can get the document link using following line: var url = _spPageContextInfo.webAbsoluteUrl + oListItem.get_item('FileRef');


0

Please look at the EncodedAbsUrl, FileDirRef, and FileRef properties. The one you use depends on your needs but I suspect you'll want EncodedAbsUrl or FileRef. Here is an example of what each returns: EncodedAbsUrl: http://yourserver.com/Pages/home.aspx FileDirRef: /Pages FileRef: /Pages/home.aspx var ctx = new SP.ClientContext(siteUrl); var items = ...



Top 50 recent answers are included