Tag Info

Hot answers tagged

4

Use SPservices as only SharePoint Designer is enough for it to work. It may not work if list item exceeds list view threshold in some cases. Also it depends lot on browser compatibility of jQuery. But this is simplest method that you can use to do cascading dropdown although its not very reliable $().SPServices.SPCascadeDropdowns({ relationshipWebURL: "", ...


2

Yes you can, below should help: string query = "<Where>Your Query</Where>"; SPList empList = web.Lists["Employee Information"]; SPView view = empList.Views["View1"]; SPQuery qry = new SPQuery(view); qry.Query = query; SPListItemCollection items = empList.GetItems(qry);


2

Apps are subject to certain restrictions, so there are concrete instances of when Apps are not a valid choice for your solution. Here are the limitations I am aware of regarding SharePoint Apps: You cannot use any non-declarative code other than JavaScript. So if you need to use the Managed Client Object Model for your solution, you cannot use a SharePoint ...


2

You have to make a POST to _api/contextinfo to get a form digest. Scot Hillier has a library to help. http://www.shillier.com/archive/2013/09/08/managing-sharepoint-2013-app-context.aspx


2

REST (with jQuery.ajax): $.ajax({ url: "/_api/lists/getByTitle('Test')/getItemById(1)/AttachmentFiles/getByFileName('test.txt')", method: 'DELETE', headers: { 'X-RequestDigest': $('#__REQUESTDIGEST').val() } }); You can see the REST API endpoints at http://msdn.microsoft.com/en-us/library/office/jj860569(v=office.15).aspx . And you can see ...


2

From a user perspective, there is no difference between web parts and app parts. Both add functionality to a SharePoint page. Technically web parts run inside a SharePoint context, and as a consequence may make an entire page unresponsive if the web part fail to load. An App part run outside SharePoint context and displays its result in an iFrame. If an app ...


2

I just did a simple test, and this code works just fine: var context = SP.ClientContext.get_current(); var item = context.get_web().get_lists() .getByTitle('Test') .addItem(new SP.ListItemCreationInformation()); item.set_item('MyField', ['Hello', 'World']); item.update(); context.executeQueryAsync(); And this is quite identical to your code, so that ...


2

Use AppCatalog class for this. Proof of concept below: class StackExchangeProof { static void Main(string[] args) { var login = "admin@yourdomain.onmicrosoft.com"; var password = "YourHardP@ssw0rd"; var url = "https://yourdomain.sharepoint.com"; var creds = new SharePointOnlineCredentials(login, ...


2

You need to use SP.AppContextSite(@target) to make the REST Url in order to access hostweb list: Here is an example: function getHostWebListsUsingREST() { var executor; // although we're fetching data from the host web, SP.RequestExecutor gets initialized with the app web URL.. executor = new SP.RequestExecutor(appweburl); ...


1

The permission Scope Web will allow you to work with Host web site. Suppose you have a site collection at url http://sitename. And under it you have a sub site http://sitename/subsite. Now you deploy an app in the subsite. So the subsite will be the Host web. Now you want to create a list in subsite so you will need to provide Web Scope. However, if you ...


1

Generally to stop the framing attacks the site has iframe disabled. The iframe can be disabled at page level or IIS level. Page Level : Check if the page has meta tag saying DENY eg meta name=”X-FRAME-OPTIONS” content=”DENY” /> OR IIS setting : Follow these steps: 1. Open Internet Information Services (IIS) Manager. 2. In the Connections pane on the left ...


1

Since you mentioned that are using jQuery.ajax, you could print the error details using error handler as demonstrated below: $.ajax({ url: siteurl + "/_api/web/lists/getbytitle('" + listName + "')/items", method: "GET", headers: { "Accept": "application/json; odata=verbose" }, success: function (data) { //... ...


1

Following example shows how to break role inheritance of a list item and give current user Contribute permissions to the item. var siteUrl = '/sites/MySiteCollection'; function breakSecurityInheritanceAddUser() { var clientContext = new SP.ClientContext(siteUrl); var oList = clientContext.get_web().get_lists().getByTitle('MyList'); var itemId ...


1

This example will reverse the order, works for me: var c = SP.ClientContext.get_current(); var folder = c.get_web().get_lists().getByTitle(<list title>).get_rootFolder(); c.load(folder, 'ContentTypeOrder'); c.executeQueryAsync(function() { folder.set_uniqueContentTypeOrder(folder.get_contentTypeOrder().reverse()); folder.update(); ...


1

There are really only two ways that you can overcome this and only one of them is controllable by you. The bad answer is that each visitor can change a setting in their browser to allow mixed content. That's just not a practical solution. I'd argue it's just bad all the way around. You will need to use a proxy to get the data for you. You could use the ...


1

Since $expand operator specifies which projected fields from a joined list are returned, the REST query: /_api/web/lists/GetByTitle('<List Title>')/items(<Item Id>)/?$expand=ContentType returns list item entity with content type entity. In order to return the specific item properties along with Content Type properties, you should use ...


1

I can think of following differences between app parts and webparts: SharePoint Server Object Model code is not allowed in app parts (only client object model code is allowed) whereas web parts allow both Sever and Client object model code. App parts provide deployment isolation. However, deployment of web parts causes files to get deployed to 15 hive, ...


1

You need to deploy the app to app catalog on central administration site. Another options is to use appregnew.aspx, then use same AppID as ClientID as the web app has, then upload the app to the Site Collection. If you want to insert the app into a page (insert app part) you need to use Client Web Part.


1

Surfacing an app as app part is like using a web part on a page in traditional development. The navigation (left navigation, top navigation, etc) is retained. However, if you simply use an app, then by default you get a chrome control which helps in navigating back to SharePoint host web and also applies the styles. However, you loose all navigation (like ...


1

Solution I assume that you use jQuery! I expect that you have the following div somewhere on your app page: <div id="chrome_ctrl_container"></div> Then you build your chrome control like you normally would do and hide your container div. $('#chrome_ctrl_placeholder').hide(); var options = { ...


1

The logs say : Memory gates checking failed because the free memory (144322560 bytes) is less than 5% of total memory. As a result, the service will not be available for incoming requests. To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element. ...


1

Here is Microsofts guidance: The most important guidance we can give you is to develop an app for SharePoint instead of a farm solution or NCSS whenever you can. Apps for SharePoint have the following advantages over classic solutions: Provide users with the easiest discovery, purchase, and installation process. Give administrators the ...


1

To develop apps for SahrePoint Online you should select 'App for SharePoint' instead of Visual Web Part. You can choose from three types of hosting options, SharePoint-hosted, Provider-hosted or Autohosted. To know what are the differences between these options take a look at: http://msdn.microsoft.com/en-us/library/office/fp179887%28v=office.15%29.aspx. If ...


1

In addition to Azure SQL DB and SharePoint Lists, the following option could be considered: SharePoint PropertyBag Many of the important SharePoint client objects support a Properties property: Web Folder ListItem File This property returns a property bag object, which is a collection of key/value pairs. Each key must be uniquely named, each value is a ...


1

You will need to find a translation service that you can access via REST such as Google's or Bing's translation APIs if they support your languages. The problem is you really should write a proxy service and host it so that it can be accessed via your app. This will prevent someone from using your API developer key. You could use SharePoint 2013's proxy if ...


1

You can simply parse the date using Javascript Date object. If different cultures are being used, you have to get the culture being used and format it accordingly. var date = oListItem.get_item('StartDate'); if(date) { date = new Date(date).format('MM/dd/yyyy'); window.console && console.log(date); } //Update var today = new Date(); ...


1

You can do it with CSS in your default.aspx file with: #s4-titlerow{ display:none!important; } This will hide the complete title area (with breadcrumb and title). Doing it with javascript is tricky since SharePoint seems to set display:block on the element with javascript as well. So if you want to go in that direction you need to find out what JS ...


1

The Content Search Web Part is the replacement. First you need to activate Cross-Site Collection Publishing site collection feature to get any data from the Content Search Web Part. The (not so) funny thing is you can add the CSWP without activating the feature, but you won't have any data presented. Be sure to have a subscription/license containing ...


1

I was playing with some sample app code and came across this same issue, but mine is a little bit different: var factory = new SP.ProxyWebRequestExecutorFactory(appWebUrl.toLowerCase()); In any case, adding the toLowerCase() method allows the code to execute properly.


1

The issue is that your POSTing another attachment before SharePoint is done processing the item with larger files. So when you try to perform another operation on the item (adding another attachment, etc) a race condition is is reached and SharePoint throws the error. When the attachment files are smaller, the process has time to complete before you start ...



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